###疑問
下のコードは.contentsの中に.left_contentと.right-contentで2カラムにしている状態です。
表示はあっていますが、一つ疑問があります。
.contentsで一度widthを940pxに指定しているのに.contents .left_content hrでwidthをさらに300pxで上書き?しています。
この場合の処理は.contentsのwidthが上書きされたと考えてよいのでしょうか?
あと、分かれば、このコードがなぜそういった記述をしているのかも知りたいです。
(行頭にいくつかある意味のないコメントアウトは無視してください)
###該当のソースコード
body, html {
height: 100%;
background-color: white;
}
h1, h2, h3, h4, h5, h6, p, body {
line-height: 1.77;
font-size: 18px;
color: #4a4a4a;
font-family: sans-serif;
margin: 0;
padding: 0;
}
.contents {
width: 940px;
margin: 0 auto;
}
.left_content {
width: 700px;
float: left;
}
.right_content {
width: 140px;
float: right;
}
.clearfix:after {
content: "";
clear: both;
display: block;
}
/**/#mainHeader {
text-align: center;
padding: 140px 0;
background: url(images/bg_header.png) no-repeat center center;
}
/**/#mainHeader p {
margin: 30px 0 0 0;
}
.contents .left_content hr {
width: 300px;
border: 0;
border-top: 1px solid #ca493c;
}
回答1件
あなたの回答
tips
プレビュー