0

我做了第二个导航,但它一直在页面上移动 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+ */

}
4

1 回答 1

-1

添加!important到您的H1

text-align: center !important;
于 2013-11-05T11:29:25.007 回答