2012年5月17日木曜日
html cssサイト作成メモ
memo
親要素の
height:auto;
は重要
margin 0 auto;
中央寄せ
@charset "utf-8";
/*コンテンツ部分*/
*{
padding: 0;
margin: 0;
}
header, footer, section, aside, nav, article {
display: block;
}
body{
background-image:url(../images/white.jpg);
background-repeat:repeat;
}
#container {
height: auto;
width: 880px;
margin:0 auto;
}
header{
width:880px;
height:auto;
background-image:url(../images/white.jpg);
background-repeat:repeat;
}
#main{
margin-left:10px;
width: 590px;
height:auto;
float: left;
}
aside#sub {
margin:10px;
width: 260px;
height: auto;
float:right;
}
footer{
float: left;
width:880px;
height:auto;
background-image: url(../images/back_footer.gif);
background-repeat: repeat-x;
height:109px;
}
<div id="container">
<header>
<div id="logo">
<a href=""><img src="" alt=""></a>
</div>
<nav>
</nav>
</header>
<section id="main">
<article id="1">
hogehoge
</article>
<article id="2">
hogehoge
</article>
</section>
<aside id="sub">
<article id="3">
</article>
</aside>
</div>
登録:
投稿 (Atom)