html - 使用 Vue.js 的按钮位置
问题描述
自从我编码以来已经有一段时间了,但我想知道如何将我的登录按钮定位在屏幕的底部中心并在其上显示图像?谢谢
代码:
<template>
<div class="container-fluid">
<img alt="Sportly logo" src="~@/assets/sportly.png">
<div class="row">
<div class="col-md-6">
<h3>Login</h3>
<button class="btn btn-primary"
@click="signIn">
<i class="fa fa-twitter"></i>
Sign In with Twitter
</button>
</div>
</div>
</div>
</template>
<script>
export default {
methods: {
signIn () {
this.$store.dispatch('signIn')
}
}
}
</script>
<style scoped>
h3 {
font-weight: 700;
}
button {
background-color: #1dcaff;
border: 1px solid #1dcaff;
positioning: absolute;
bottom: 0px;
}
div button:hover {
background-color: #00aced;
border: 1px solid #00aced;
}
</style>
解决方案
你的问题是 class col-md-6。在您的情况下,它具有样式:{width: 50%}。你需要另一个适合你情况的课程
推荐阅读
- html - 我想要带有图像的悬停文本
- javascript - cookie过期时的Javascript重定向
- mongodb - Mongodb嵌套树结构
- bash - 将 du 值分配给数组
- android - 如何在 XML 中的 TabLayout 上设置 onTabChanged 以调用 viewModel 方法?
- objective-c - 如何在mac的主目录中搜索具有特定扩展名的文件?
- orange - 如何在橙色数据挖掘中使用 Python 脚本中的简单决策树进行插补?
- php - `get_meta_tags` 没有读取 og:image
- ios - 核心在单个绘图中绘制不同的绘图符号
- r - R Flexsurv- 估计生存函数