強いテキスト*] 2 *背景画像付きの固定ナビゲーションバーの作成方法は?
*
**私は、所望の結果を得るためにこれらのHTML、およびCSSコードを試してみました。自分のHTMLやCSSに他に何を加えたり差し引いたりすればよいですか? をお勧めします。ここで
<div class="firstPart">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Gustoso</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Welcome<span class="sr-only">(current)</span></a></li>
<li><a href="#">Menu</a></li>
<li><a href="#">Reservation</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Contact</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-twitter"></i></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</div> <!--.firstPart-->
<section class="headerArea">
<h1>Pastry With Love</h1>
</section><!--.headerArea-->
CSSです:
body {
margin: 0;
padding: 0;
font-size: 14px;
color: black;
background-color: #f3f1f2;
}
.firstPart {
background: url('bannerFirst.jpg');
background-repeat: no-repeat;
background-size: cover;
background-position: center;
min-height: 100%;
padding-top: 0px;
padding-bottom: 957px;
}
.navbar-default {
background: none;
}
.navbar-default .navbar-collapse {
border-color: #e7e7e7;
background-color: transparent;
}
.backgroundImage {
width: device-width;
}
.nav navbar-nav {
font-size: 14px;
font-family: "Alegreya";
color: rgb(255, 255, 255);
text-transform: uppercase;
line-height: 1.714;
position: absolute;
left: 413.844px;
top: 23.002px;
z-index: 275;
display: inline-block;
padding-right: 44px;
padding-top: 4px;
}
.headerArea {
color: white;
font-size: 30px;
margin-top: -360px;
margin-left: 375px;
}
ここにはCSSコードがあります(これは申し訳ありません...投稿中に問題が発生しました) 本文{ \t余白:0; \tパディング:0; \t font-size:14px; \t色:黒; \t背景色:#f3f1f2; \t } .firstPart { 背景:url( 'bannerFirst.jpg'); background-repeat:no-repeat; background-size:cover; バックグラウンドポジション:center; 最小高さ:100%; パディングトップ:0px; 下敷き:957px; } .navbar-default { 背景:なし; } .navbar-default .navbar-collapse { border-color:#e7e7e7; background-color:transparent; } – Prem
CSSの残りの部分 .backgroundImage { width:device-width; } .nav navbar-nav。ようこそ_____〜_____メニュー_____〜_____予約__ { font-size:14px; font-family: "Alegreya"; 色:rgb(255,255,255); text-transform:大文字。 ラインハイト:1.714; ポジション:絶対; 左:413.844px; トップ:23.002px; z-インデックス:275; display:インラインブロック; パディング右:44px; パディングトップ:4px; } 。headerArea { 色:白; font-size:30px; margin-top:-360px; margin-left:375px; } – Prem
コメントにCSSを追加するのではなく、質問を編集してください。編集ボタンは質問の下部、タグの下にあります。 –