index.html
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>スプリットレイアウトの作成</title> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/jquery.bxslider.css"> <link rel="stylesheet" href="css/hamburgers.css"> <style> .hamburger-inner, .hamburger-inner::before, .hamburger-inner::after { background-color: #FFF; } .hamburger.is-active .hamburger-inner, .hamburger.is-active .hamburger-inner::before, .hamburger.is-active .hamburger-inner::after { background-color: #FFF; } .hamburger:hover { opacity: 1; } .hamburger.is-active:hover { opacity: 1; } </style> </head> <body> <header> <div class="header-inner"> <h1>Net Smart</h1> <p class="tag-line">よりスマートなインターネットライフを</p> </div> <nav id="g-nav"> <ul> <li><a href="#">Top<span>トップ</span></a></li> <li><a href="#">About<span>会社概要</span></a></li> <li><a href="#">Service<span>事業内容</span></a></li> <li><a href="#">Contact<span>お問い合わせ</span></a></li> </ul> </nav> </header> <p class="hamburger hamburger--spin" id="btn"> <span class="hamburger-box"> <span class="hamburger-inner"></span> </span> </p> <main> <div class="main-visual"> <ul class="bxslider"> <li><img src="img/slide-01.jpg" alt=""></li> <li><img src="img/slide-02.jpg" alt=""></li> <li><img src="img/slide-03.jpg" alt=""></li> </ul> </div> <div class="content"> <h2>必要なものは、<br> ビジネスの価値を届けるデザインの力</h2> <p class="lead">Net Smartは、ビジネスとユーザーを理解し、 関係性を構築するためのストーリーの設計とUXデザインをご提供し、 よりスマートなインターネットライフを送るお手伝いを致します。</p> <div class="content-box"> <h3>私たちについて</h3> <p class="content-img"><img src="https://placehold.jp/45488a/ffffff/800x600.jpg" alt=""></p> <p class="content-txt">Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus, reprehenderit!</p> <p class="conent-btn button01"> <a href="#">詳細はこちら</a> </p> </div> <div class="content-box"> <h3>サービスについて</h3> <p class="content-img"><img src="https://placehold.jp/45488a/ffffff/800x600.jpg" alt=""></p> <p class="content-txt">Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus, reprehenderit!</p> <p class="conent-btn button23"> <a href="#">詳細はこちら</a> </p> </div><!-- /.content-box --> <form action="#" method="post"> <dl> <dt>お名前<span>必須</span></dt> <dd><input type="text" name="" required placeholder="お名前を入力して下さい" autocomplete="name"></dd> <dt>メールアドレス<span>必須</span></dt> <dd><input type="email" name="" required placeholder="メールアドレスを入力して下さい" autocomplete="email"></dd> <dt>性別</dt> <dd> <label for="male"><input type="radio" name="gender" value="男性" checked id="male">男性</label> <label for="female"><input type="radio" name="gender" value="女性" id="female">女性</label> </dd> <dt>お問い合わせ内容<span>必須</span></dt> <dd><textarea name="" required placeholder="お問い合わせ内容を入力して下さい"></textarea></dd> </dl> <p class="form-btn"> <input type="submit" value="送信"> <input type="reset" value="リセット"> </p> </form> <div id="to-top" class="button30"> <a href="#"></a> </div> </div><!-- /.content --> </main> <footer> <ul class="sns"> <li><a href="#"><img src="img/twitter-square-brands.svg" alt=""></a></li> <li><a href="#"><img src="img/instagram-square-brands.svg" alt=""></a></li> <li><a href="#"><img src="img/line-brands.svg" alt=""></a></li> </ul> <p><small>© Net Smart</small></p> </footer> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script src="js/jquery.bxslider.js"></script> <script> $(function(){ $('.bxslider').bxSlider({ mode: 'fade', auto: true, pager: false, controls: false, speed: 2000, touchEnabled: false, }); //スムーススクロール部分 $('#to-top>a').on('click',function(){ $('html,body').animate({scrollTop:0}); }); //ハンバーガー $('#btn').on('click',function(){ $(this).toggleClass('is-active'); $('#g-nav').fadeToggle(); }); }); </script> </body> </html>
style.css
@charset "utf-8"; :root{ --base_color:#f0ecd4; --main_color:#215477; } /*! * ress.css • v1.2.2 * MIT License * github.com/filipelinhares/ress * 全ての要素にbox-sizing: border-box;. * 全ての背景画像にbackground-repeat: no-repeat. */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}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]{-webkit-appearance:textfield}[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 ButtonText}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}button,select{text-transform:none}button,input,select,textarea{background-color:transparent;border-style:none;color:inherit}select{-moz-appearance:none;-webkit-appearance:none}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]{-webkit-appearance:textfield;outline-offset:-2px}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;}.wrapper{overflow:hidden;}body{overflow-y:scroll;}*{box-sizing:border-box;} body{ background-color: var(--base_color); } /* header部分 */ header{ width: 100%; height: 100px; background-color:var(--main_color); display: flex; justify-content: space-between; align-items: center; color: #FFF; padding: 0 30px; position: fixed; top: 0; left: 0; z-index: 100; } #g-nav>ul{ display: flex; justify-content: center; } #g-nav li{ margin: 0 20px; } #g-nav a{ display: block; color: #FFF; text-align: center; font-size: 20px; padding: 10px; } #g-nav span{ display: block; font-size: 14px; } #g-nav a:hover>span{ text-decoration: underline; text-decoration-color: var(--base_color); text-decoration-thickness: 2px;/* 線幅 */ text-underline-offset: 4px;/* 線の位置 */ } main{ display: flex; position: relative; } .main-visual{ width: 50%; height: calc(100vh - 100px); position: sticky; top: 100px; left: 0; } .main-visual li{ width: 100%; height: calc(100vh - 100px); } .main-visual img{ object-fit: cover; width: 100%; height: 100%; } .content{ width: 50%; padding: 130px 20px 40px; } .content img{ max-width: 100%; } footer{ width: 100%; height: 400px; background-color: #FFF; } .sns{ display: flex; justify-content: center; padding: 50px 0; } .sns>li{ width: 50px; margin: 0 20px; } footer>p{ text-align: center; padding: 20px 0; } /* ボタンスニペット部分 */ .button01 a { display: flex; justify-content: space-between; align-items: center; margin: 50px auto 100px; padding: 1em 2em; width: 300px; color: #333; font-size: 18px; font-weight: 700; background-color: #cccccc; transition: 0.3s; } .button01 a::after { content: ''; width: 5px; height: 5px; border-top: 3px solid #333333; border-right: 3px solid #333333; transform: rotate(45deg); } .button01 a:hover { text-decoration: none; background-color: #d47d7d; } .button23 a { display: block; position: relative; margin: 50px auto 100px; padding: 1em 2em; width: 300px; color: #333; font-size: 18px; font-weight: 700; background-color: #cccccc; transition: 0.3s; } .button23 a::after { content: ''; position: absolute; bottom: 10px; right: 10px; width: 0; height: 0; border-style: solid; border-width: 0 0 12px 12px; border-color: transparent transparent #333333 transparent; transition: 0.3s; } .button23 a:hover { text-decoration: none; background-color: #bbbbbb; } .button23 a:hover::after { bottom: 8px; right: 8px; } .button30 a { display: flex; justify-content: center; align-items: center; margin: 0 auto; width: 80px; height: 80px; background-color: #cccccc; border: 3px solid #aaaaaa; border-radius: 50vh; transition: 0.3s; } .button30 a::after { content: ''; width: 7px; height: 7px; border-top: 3px solid #333; border-left: 3px solid #333; transform: rotate(45deg); transition: 0.3s; } .button30 span { width: 0px; height: 0px; visibility: hidden; } .button30 a:hover { background-color: #333333; } .button30 a:hover::after { border-top: 3px solid #f2f2f2; border-left: 3px solid #f2f2f2; transform: translateY(-5px) rotate(45deg); } /* form部分 */ form{ width: 96%; margin: 100px auto; } dl{ display: flex; flex-wrap: wrap; border: 1px solid #333; margin-bottom: 30px; } dt{ width: 35%; background-color: var(--main_color); color: #FFF; padding: 20px; border-right: 1px solid #333; } dd{ width: 65%; padding: 20px; } dt:nth-of-type(n+2),dd:nth-of-type(n+2){ border-top: 1px solid #333; } [type="text"],[type="email"]{ border: 1px solid #333; padding: 5px; width: 80%; } [type="radio"]{ margin: 0 10px; transform: scale(1.3); } textarea{ border: 1px solid #333; padding: 5px; width: 100%; height: 160px; } dt>span{ background-color: #FFF; color: var(--main_color); font-size: 12px; padding: 2px 4px; font-weight: bold; display: block; width: 3em; margin-top: 10px; } [type="submit"]{ padding: 20px 100px; background-color: var(--main_color); color: #FFF; margin-right: 30px; } [type="reset"]{ padding: 20px 40px; background-color: #FFF; } [type="submit"]:hover{ background-color: #555a61; } [type="reset"]:hover{ opacity: 0.7; } /* モバイルレイアウト */ @media (max-width:850px){ /* header部分 */ header{ height: 70px; padding: 0 10px; } h1{ font-size: 24px; } .tag-line{ font-size: 14px; } /* ナビゲーション部分 */ #g-nav{ display: none; position: fixed; width: 100%; height: calc(100vh - 70px); top: 70px; left: 0; background-color: #7e7c74; } #g-nav>ul{ display: block; padding-top: 40px; } #btn{ position: fixed; right: 0; top: 0; z-index: 1000; } main{ display: block; } .main-visual{ width: 100%; height: 50vh; position: static;/* positionのキャンセル */ } .main-visual li{ height: 50vh; } .content{ width: 100%; padding: 40px 10px; } /* フォーム部分 */ dl{ display: block; border: 1px solid #333; } dt{ width: 100%; padding: 10px; border-right: 0; } dd{ width: 100%; padding: 10px; } [type="submit"]{ padding: 10px 60px; margin-right: 20px; } [type="reset"]{ padding: 10px 30px; } }