index.html
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>スマホ特化型サイトの作成</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <header> <h1>Lorem, ipsum dolor.</h1> <p class="tag-line">Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium, blanditiis?</p> <p class="ticket"><img src="https://placehold.jp/1000x400.png" alt=""></p> <nav id="pc-nav"> <ul> <li><a href="#news">News</a></li> <li><a href="#culture">Culture</a></li> <li><a href="#access">Access</a></li> <li><a href="#gallery">Gallery</a></li> </ul> </nav> </header> <div class="container"> <p class="topic">Lorem ipsum dolor sit amet.</p> <div class="main-visual"> <img src="https://placehold.jp/1000x1200.png" alt=""> </div> <div class="main-copy"> <h2>Lorem ipsum dolor sit amet consectetur adipisicing elit.</h2> <p class="lead">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Exercitationem deserunt numquam vitae accusamus, quae eius.</p> </div><!-- /.main-copy --> <main> <section class="section-page" id="news"> <h3 data-ja="お知らせ">News</h3> </section> <section class="section-page" id="culture"> <h3 data-ja="こだわり">Culture</h3> </section> <section class="section-page" id="access"> <h3 data-ja="会場">Access</h3> </section> <section class="section-page" id="gallery"> <h3 data-ja="イベントの様子">Gallery</h3> </section> </main> </div><!-- /.container --> </body> </html>
style.css
@charset "utf-8"; html{box-sizing:border-box;-webkit-text-size-adjust:100%}*,:after,:before{background-repeat:no-repeat;box-sizing:inherit}:after,:before{text-decoration:inherit;vertical-align:inherit}*{padding:0;margin:0;box-sizing:border-box;}audio:not([controls]){display:none;height:0}hr{overflow:visible}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}summary{display:list-item}small{font-size:80%}[hidden],template{display:none}abbr[title]{border-bottom:1px dotted;text-decoration:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}code,kbd,pre,samp{font-family:monospace,monospace}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}input{border-radius:0}[role=button],[type=button],[type=reset],[type=submit],button{cursor:pointer}[disabled]{cursor:default}[type=number]{width:auto}[type=search][type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{overflow:auto;resize:vertical}button,input,optgroup,select,textarea{font:inherit}optgroup{font-weight:700}button{overflow:visible}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:0;padding:0}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button:-moz-focusring{outline:1px dotted}[type=reset],[type=submit],button,html [type=button]button,select{text-transform:none}button,input,select,textarea{background-color:transparent;border-style:none;color:inherit}select::-ms-expand{display:none}select::-ms-value{color:currentColor}legend{border:0;color:inherit;display:table;max-width:100%;white-space:normal}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[type=search]img{border-style:none;vertical-align: bottom}progress{vertical-align:baseline}svg:not(:root){overflow:hidden}audio,canvas,progress,video{display:inline-block}@media screen{[hidden~=screen]{display:inherit}[hidden~=screen]:not(:active):not(:focus):not(:target){position:absolute!important;clip:rect(0 0 0 0)!important}}[aria-busy=true]{cursor:progress}[aria-controls]{cursor:pointer}[aria-disabled]{cursor:default}::-moz-selection{background-color:#b3d4fc;color:#000;text-shadow:none}::selection{background-color:#b3d4fc;color:#000;text-shadow:none}ul,ol{list-style:none;}a{text-decoration:none;}img{max-width: 100%;vertical-align: bottom;} /* 変数の登録 */ :root{ --base_color:#E8E3D8; --color_1:#257C4D; --color_2:#E8C468; --color_3:#92C1BB; --color_4:#5F514A; --text_color:#444444; } html{ scroll-behavior: smooth; } body{ background-color: var(--base_color); color: var(--text_color); display: flex; flex-direction: row-reverse; } header{ width: 42%; border: 1px solid var(--text_color); padding: 20px; border-radius: 10px; color: var(--color_1); position: fixed; top:50px; left: 3%; } .container{ width: 42%; background-color: #d6d1c4; margin-right: 3%; } .section-page{ height: 100vh; }