2014-01-27 163 views
3

我有我的website,如果向上滚动,您会看到标题正好在中心线上方。我无法弄清楚如何让它和紫色的一样。有任何想法吗?标题不垂直对齐

代码绿色页标题:

.main section.page3 h1 { 
     text-align: center; 
     padding: 0; 
     margin-bottom: 0; 
     font-size: 70px; 
     letter-spacing: -1px; 
     color: black; 
    } 

,紫页:

.main section.page2 > img { 
     position: absolute; 
     top: -300px; 
     left: 50%; 
     margin-left: -1095px; 

我有什么:

enter image description here

我想要什么: enter image description here

回答

3

我在开发人员工具中查看了它,看起来您只需删除一些边距。他们在.page2 .page_container元素上,并且.page2 h1元素:

.main section.page2 .page_container { 
    margin-top: 240px;     /* Remove this. */ 
    overflow: hidden; 
} 
.main section.page2 h1 { 
    text-align: center; 
    padding: 0; 
    margin-top: 150px;     /* Remove this. */ 
    font-size: 50px; 
    letter-spacing: -1px; 
    color: white; 
} 
+2

非常感谢。我一直在玩它几个小时。 – Alex

+1

@ user3217296不客气,很高兴帮助。 –

+3

@ user3217296然后您应该将此答案标记为已接受。 –