CSSのDiv classを指定して背景を画像にしようとしていますが、
うまく設定されません。
どなたかご指導頂きたく。
宜しくお願いします。
※アドレスや画像の名前誤りはなく、画像は「img」フォルダに格納済みです。
(html)
<head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="css/style.css"> <body id="sample"> <div id="web" ><!-- web開始 --> <div id="menu"><!-- menu開始 --> <div class="top"><!-- TOP画 --> test </div><!-- top終了 -->
(CSS)
body { margin:0; font-size: 1em; } #web { width: 90%; margin: auto; padding: 0%; } #head { width: 100%; } #menu { width: 20%; margin-top: 10px; display: block; float: left; } #main { width: 79%; float: right; } .top { width: 100%; height: 200px; background-image: url("img/top.png"); }
(フォルダ階層)
homepage---index.html
css--------style.css
img---top.png
回答1件
あなたの回答
tips
プレビュー