HTML
1<!doctype html> 2<html lang="ja"> 3 <head> 4 <!-- Required meta tags --> 5 <meta charset="utf-8"> 6 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 7 8 <!-- Bootstrap CSS --> 9 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> 10 <link rel="stylesheet" href="style.css"> 11 <title>NESTonline</title> 12 </head> 13 <body> 14 <div id="wrapper"> 15 <header> <!--vvv--HEADER--vvv--> 16 <h1> 17 京都の学生向けオーガニックヘアサロンなら<br> 18 <span>NESThair</span> 19 </h1> 20 <ul class="nav"> 21 <li class="nav-item"> 22 <a class="nav-link" href="#">ホーム</a> 23 </li> 24 <li class="nav-item"> 25 <a class="nav-link" href="#">メニュー</a> 26 </li> 27 <li class="nav-item"> 28 <a class="nav-link" href="#">ご予約</a> 29 </li> 30 </ul> 31 </header> <!--^^^--HEADER--^^^--> 32 </div> <!--^^^--WRAPPER--^^^--> 33 34 35 36 37 38 39 40 41 42 43 <!-- Optional JavaScript --> 44 <!-- jQuery first, then Popper.js, then Bootstrap JS --> 45 <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> 46 <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> 47 <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> 48 </body> 49</html>
CSS
1@charset "utf-8"; 2 3/*------------WRAPPER------------------------------------------------*/ 4.wrapper { 5 width: 960px; 6 margin: 0 auto; 7 8} 9/*-----------HEADER-------------------------------------*/ 10header { 11 width: 960px; 12 height: 49px; 13 margin: 0 auto; 14 position: relative; 15 padding: 20px 0; 16} 17header h1{ 18 font-size: 12px; 19 padding-left: 51px; 20 background: url(images/logo.png) no-repeat; 21 height: 49px; 22 line-height: 1; 23} 24header span { 25 font-size: 33px; 26 font-weight: bold; 27 margin-top: 10px; 28} 29 30.nav{ 31 position: absolute; 32 bottom: -30px; 33 right: 0; 34} 35header ul li a{ 36 font-size: 16px; 37 font-weight: bold; 38 color: #734339; 39 text-decoration: none; 40} 41header ul li a:hover{ 42 border-bottom: 5px solid #345c39; 43} 44 45/*-----------MAINIMAGE-----------------------------------*/ 46 47/*-----------LEFT---------------------------------------*/ 48 49/*--------------RIGHT--------------------------------*/ 50
ナビのところにカーソルが当たると下線が出るようにしたのですが、
なぜか文字が少し上に動いてしまいます。
動かないようにしたいのですが、お知恵を拝借できませんでしょうか。
試したこと
ナビの位置を変えてみたりborderの線を細くしたが、効果なし。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/18 12:06