こんばんは。見てくださってありがとうございます。
ぜんぜん簡単なことなのかもしれませんが、
下記のhtmlとcssでなぜnavがwrapperの
下のほうに配置されてしまうのか、
sectionの周りにできてしまう余白はなんなのか
がわからないです。
初歩的な質問で申し訳ございません。
よろしくお願いいたします。
html
<!doctype html> <html> <head lang="ja"> <meta charset="utf-8"> <title>test</title> <meta name="description" content=""> <link type="text/css" rel="stylesheet" href="style.css"> </head> <body> <header> </header> <div id="wrapper"> <nav> <ul> <li>1</li><!-- --><li>2</li><!-- --><li>3</li><!----> </ul> </nav> <section> </section> </div> <footer> </footer> </body> </html> ------------------------------------------css
*{
margin:0;
padding:0;
}
header{
width:100%;
height:300px;
background:#000;
}
div#wrapper{
width:960px;
margin:0 auto;
}
nav{
display:inline-block;
width:500px;
background:#00f;
}
nav ul li{
color:#fff;
}
section{
display:inline-block;
width:450px;
height:100px;
background:#0f0;
}
footer{
width:100%;
height:100px;
background:#aaa;
}
そもそもですが…あなたはどのようにレイアウトしたいのかがわかりません。
どうしたいのかがわからずに、なぜかを問われても回答の仕様がありません。
回答3件
あなたの回答
tips
プレビュー