【问题标题】:CSS padding/margin issue in Opera 12.02?Opera 12.02 中的 CSS 填充/边距问题?
【发布时间】:2012-10-23 05:50:59
【问题描述】:

您好 StackOverflow 用户,

我正在为自己开发一个新的个人网站,并且发现 Opera 12.02(我在 Mac 上)非常棘手。出于某种原因,几乎所有东西的定位都完全关闭,除了它全部打包的容器。所以我猜这是一个填充/边距/行高问题。这是网站:http://www.tommaxwell.me。有人可以帮我吗?

CSS:

    body {
padding: 0 auto;
margin: 0 auto;


}

@-moz-document url-prefix() {
* { font-weight: 100; }
h1, h2 
}



#sitecontent {
display: block;
width: 780px;
padding-top: 150px;
margin: 0 auto;
}


#sitecontent .leftsidebar {
float: left;
width: 150px;
}

#profilepic {
-moz-border-radius: 20px;
border-radius: 20px;
}
#sitecontent .leftsidebar ul {
position: relative;
top: -5px;
list-style-type: none;
font-family: 'Cantora One', sans-serif;

 }


#sitecontent a {
text-decoration: none;
color: #3f83ca;
}




#sitecontent .leftsidebar ul li{
margin-bottom: 2px;
}

#sitecontent a:hover {
opacity: 0.9;

}

#sitecontent .rightsidebar {
float: right;
width: 600px;

}

#sitecontent .rightsidebar > h1 {
font-size:60px;
color: #3f83ca;
line-height: 0;
font-family: 'Cantora One', sans-serif;

}

#sitecontent .rightsidebar > h2 {
line-height: 10px;
color: #38414f;
font-family: 'Cantora One', sans-serif;
}

#sitecontent .rightsidebar > p {
padding-top: 16px;
line-height: 20px;
font-family: 'Cantora One', sans-serif;



}

#secondparagraph {
opacity: 0.5;


}

#secondparagraph:hover {
color:#3f83ca;
opacity: 1.0;

}

#secondparagraph a {
text-decoration: none;
color: inherit;
}

【问题讨论】:

  • 仅供参考,您的 @-moz-document 规则有一个悬空选择器。
  • @BoltClock - 哦,是的,我在发帖后解决了这个问题。

标签: css cross-browser containers opera


【解决方案1】:

#sitecontent 中添加到 overflow:hidden 在 css 中

像这样

#sitecontent{
overflow:hidden;
}

【讨论】:

    【解决方案2】:

    这行得通。

    x:-o-prefocus, h1 {
    padding-top: 22px;
    }
    
    x:-o-prefocus, h2 {
    margin-top: -24px;
    }
    

    【讨论】:

    • 众所周知,IE7 可以做到这一点。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-28
    • 2012-07-27
    • 1970-01-01
    • 1970-01-01
    • 2018-01-20
    相关资源
    最近更新 更多