navタグにスタイルが反映されないです。セレクタのあとに半角のスペースを入れたりしました。
chrome developerで検証して調べてみるとheightプロパティは反映されているのが分かり、backgrond-colorプロパティは取り消し線がかかれているのが分かりました。コードを載せますのでご教授お願いします。
html コード <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Denatal</title> <link rel="stylesheet" href="dental.css"> <style> /* html5doctor.com Reset Stylesheet v1.6.1 Last Updated: 2010-09-17 Author: Richard Clark - http://richclarkdesign.com Twitter: @rich_clark */ html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; } body { line-height: 1; } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } nav ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } a { margin: 0; padding: 0; font-size: 100%; vertical-align: baseline; background: transparent; } /* change colours to suit your needs */ ins { background-color: #ff9; color: #000; text-decoration: none; } /* change colours to suit your needs */ mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; } del { text-decoration: line-through; } abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; } table { border-collapse: collapse; border-spacing: 0; } /* change border colour to suit your needs */ hr { display: block; height: 1px; border: 0; border-top: 1px solid #cccccc; margin: 1em 0; padding: 0; } input, select { vertical-align: middle; } body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; } </style> </head> <body> <header> <div class="inner"> <h1><a href=""><img src="template-logo01.png" alt="病院"></a></h1> <ul> <li> <h2>お電話での予約はこちら </h2> <p>03-1234-5678</p> </li> <li><a href="">WEB予約</a></li> </ul> </div> </header> <nav> <ul> <li>MENU</li> <li>MENU</li> <li>MENU</li> <li>MENU</li> <li>MENU</li> <li>MENU</li> <li>MENU</li> <li>MENU</li> <li>MENU</li> </ul> </nav> <div class="background"> <div class="inner"> <div class="inner-content"> <h2>HELLO WORLD</h2> <p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information </p> <hr> <p> It uses utility classes for typography and spacing to space content out within the larger container. </p> </div>Ï </div> </div> </body> </html>
css コード @charset "utf-8"; header img{width:200px; } .inner{width:1140px; margin:0 auto;} nav ul{width:1140px;} header{text-align:right;} header ul li{display:inline-block;} nav ul li{display:inline-block ; padding:0px 35px; color:rgba(255,255,255,.5);} .background{background-image:url(top-image.jpg) ; height:1200px; background-repeat:no-repeat;} nav {background-color:#343A40;height:30px;} .inner-content{width:555px;height:302px; background-color:white;}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/02/12 11:30
2021/02/12 11:47
2021/02/12 11:58
2021/02/12 13:08