我做了第二次导航,但它继续在页面上移动H1 h1中的文本需要保留在中心,但它保持movig尝试一些事情没有工作 我用过这个css
.nav2 {
position: relative;
float: left;
top:190px;
left:24px;
}
.nav2 a {
position: relative;
display: block;
text-decoration: none;
text-align: center;
font-family: sans-serif;
font-size: 15px;
font-weight: bold;
color: #777777;
border: 1px solid black;
border-radius: 20px 0px 0px 20px;
top: 5px;
left: 2px;
padding-top: 9px;
padding-bottom: 9px;
padding-left: 49px;
padding-right: 49px;
margin-bottom: 3px;
background: -webkit-linear-gradient(top, rgba(37,38,41,1) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
}
h1 css
.home h1, .services h1, .projecten h1 {
position: relative;
top: -75px;
text-align: center;
border: 1px solid black;
border-radius: 3px;
width: 1000px;
padding-top: 4px;
padding-bottom: 4px;
color: #777777;
background-color: black;
background: -webkit-linear-gradient(top, rgba(54,54,54,1) 0%,rgba(21,21,21,1) 50%,rgba(16,16,16,1) 51%,rgba(36,36,36,1) 100%); /* Chrome10+,Safari5.1+ */
}
答案 0 :(得分:-1)
将!important
添加到H1
:
text-align: center !important;