※ 首頁重點:
index.html:
<body>
<!-- 主結構 -->
<div class="wrapper">
<!-- Start main -->
<section class="main">
<!-- Start jumbotron -->
<div class="jumbotron">
<!-- 遮罩元件 -->
<div class="mask-dark"></div>
<div class="container">
<div class="logo-image" style="background-image: url('images/common/logo-w.png');"></div>
</div>
</div>
<!-- End jumbotron -->
</section>
<!-- End main -->
</div>
</body>
style.css:
.mask-dark {
background-color: rgba(0, 0, 0, 0.7);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.jumbotron {
border: 1px solid #000;
padding-top: 224px;
padding-bottom: 160px;
background-image: url('../images/bg/bg001.jpg');
background-size: cover;
background-attachment: fixed;
}
.jumbotron .logo-image {
width: 320px;
height: 320px;
border: 1px solid #000;
background-position: center;
background-size: contain;
background-repeat: no-repeat;
margin: 0 auto;
}
成果顯示:
※ 首頁按鈕:
index.html:
<body>
<!-- 主結構 -->
<div class="wrapper">
<!-- Start main -->
<section class="main">
<!-- Start jumbotron -->
<div class="jumbotron">
<div class="container">
<!-- 按鈕 -->
<!-- 按鈕置中 -->
<div class="btn-group-center">
<a href="#!" class="btn btn-primary btn-lg">這是一個按鈕</a>
<a href="#!" class="btn btn-sceondary btn-lg ">這是一個按鈕</a>
</div>
</div>
<!-- End jumbotron -->
</section>
<!-- End main -->
</div>
</body>
style.css:
.btn {
display: inline-block;
vertical-align: top;
font-size: 16px;
line-height: 24px;
padding: 4px 16px;
border: 1px solid #fff;
color: #fff;
border-radius: 4px;
transition: all 0.3s;
}
.btn.btn-primary {
background-color: #d5a26f;
border: 1px solid #d5a26f;
color: #fff;
}
.btn.btn-primary:hover {
background-color: #b2875c;
border: 1px solid #b2875c;
}
.btn.btn-secondary {
border: 1px solid #d5a26f;
color: #d5a26f;
}
.btn.btn-secondary:hover {
background-color: #d5a26f;
color: #fff;
}
.btn.btn-lg {
padding: 8px 32px;
}
.btn-group-center {
border: 1px solid #fff;
text-align: center;
}
.btn-group-center .btn {
margin-left: 12px;
margin-right: 12px;
}
成果顯示:
※ 圖片和按鈕的間距:
style.css:
.jumbotron .btn-group-center {
margin: 8px;
}
成果顯示:
※ 關於餐廳內容:
index.html:
<!-- Start about -->
<!-- 做出上下padding -->
<div class="hero hero-bg-white">
<!-- 置中版 -->
<div class="container">
<div class="row">
<div class="col-1-2">
<div class="about-preview">
<h3 class="title">每杯咖啡留著手的餘溫</h3>
<p class="para">
一個咖啡有溫度的故事,只要咖啡加熱、沸騰到攝氏100度,你就可以用手摸摸看,應該會十分的燙手,一個咖啡有溫度的故事,只要咖啡加熱、沸騰到攝氏100度,你就可以用手摸摸看,應該會十分的燙手。</p>
<a href="#!" class="btn btn-primary">更多我們的故事</a>
</div>
</div>
<div class="col-1-2">
<!-- 4:3結構框 -->
<div class="image-container">
<div class="image" style="background-image: url('images/products/product005.jpg');"></div>
</div>
</div>
</div>
</div>
<!-- End about -->
style.css:
.col-1-2,
.col-1-3,
.col-1-4 {
border: 1px solid red;
float: left;
padding-left: 16px;
padding-right: 16px;
}
.image-container {
width: 100%;
border: 1px solid #000;
}
.image-container:before {
content: '';
display: block;
width: 100%;
padding-top: 75%;
}
.image-container .image {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
.hero {
padding-top: 200px;
padding-bottom: 200px;
border: 1px solid #000;
}
.hero.hero-bg-white {
background-color: #fefefe;
}
.hero.hero-bg-grey {
background-color: #efefef;
}
.about-preview .title {
font-size: 32px;
color: #333;
margin-bottom: 24px;
margin-top: 80px;
}
.about-preview .para {
font-size: 16px;
line-height: 32px;
text-align: justify;
color: #333;
margin-bottom: 24px;
}
成果顯示:
※ 服務內容:
index.html:
<!-- Start services -->
<!-- 上下區塊推擠 -->
<div class="hero hero-bg-grey">
<!-- 置中版 -->
<div class="container">
<!-- 區段介紹 -->
<div class="section-intro">
<!-- 標題 -->
<h2 class="title">SERVICES</h2>
<!-- 文字說明 -->
<p class="para">
我們提供的服務在這裡有初步的介紹,諸如此類的介紹等等<br>多的文字就可以換行繼續寫</p>
</div>
<!-- 三欄式版型 -->
<div class="row">
<div class="col-1-3">
<div class="service-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product001.jpg');"></div>
</div>
<div class="preview">
<h4 class="title">香濃的咖啡香濃的咖啡香濃的咖啡香濃的咖啡香濃的咖啡香濃的咖啡</h4>
<h5 class="subtitle">現煮的香濃咖啡,優質的咖啡豆</h5>
<p class="para">
一段中文的敘述文字,說明東西的美味及外觀等等的話,一段中文的敘述文字,說明東西的美味及外觀等等的話。一段中文的敘述文字,說明東西的美味及外觀等等的話,一段中文的敘述文字,說明東西的美味及外觀等等的話。
</p>
<a href="#!" class="btn btn-secondary">Read more</a>
</div>
</div>
</div>
<div class="col-1-3">
<div class="service-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product002.jpg');"></div>
</div>
<div class="preview">
<h4 class="title">香濃的咖啡香濃的咖啡香濃的咖啡香濃的咖啡香濃的咖啡香濃的咖啡</h4>
<h5 class="subtitle">現煮的香濃咖啡,優質的咖啡豆</h5>
<p class="para">
一段中文的敘述文字,說明東西的美味及外觀等等的話,一段中文的敘述文字,說明東西的美味及外觀等等的話。一段中文的敘述文字,說明東西的美味及外觀等等的話,一段中文的敘述文字,說明東西的美味及外觀等等的話。
</p>
<a href="#!" class="btn btn-secondary">Read more</a>
</div>
</div>
</div>
<div class="col-1-3">
<div class="service-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product003.jpg');"></div>
</div>
<div class="preview">
<h4 class="title">香濃的咖啡香濃的咖啡香濃的咖啡香濃的咖啡香濃的咖啡香濃的咖啡</h4>
<h5 class="subtitle">現煮的香濃咖啡,優質的咖啡豆</h5>
<p class="para">
一段中文的敘述文字,說明東西的美味及外觀等等的話,一段中文的敘述文字,說明東西的美味及外觀等等的話。一段中文的敘述文字,說明東西的美味及外觀等等的話,一段中文的敘述文字,說明東西的美味及外觀等等的話。
</p>
<a href="#!" class="btn btn-secondary">Read more</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End services -->
style.css:
.section-intro {
text-align: center;
margin-bottom: 40px;
}
.section-intro .title {
font-size: 48px;
color: #333;
margin-bottom: 24px;
}
.section-intro .para {
font-size: 16px;
line-height: 32px;
color: #333;
}
.service-item .preview {
padding-top: 16px;
}
.service-item .title {
font-size: 24px;
color: #333;
margin-bottom: 8px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.service-item .subtitle {
font-size: 24px;
color: #d5a26f;
margin-bottom: 16px;
}
.service-item .para {
font-size: 16px;
color: #333;
line-height: 24px;
margin-bottom: 24px;
height: 72px;
overflow: hidden;
}
成果顯示:
※ 預約內容:
index.html:
<!-- Start reservation -->
<!-- 上下區塊推擠 -->
<div class="hero">
<div class="container">
<div class="section-intro">
<!-- 標題 -->
<h2 class="title">Reservation</h2>
<!-- 文字說明 -->
<p class="para">
我們提供的服務在這裡有初步的介紹,諸如此類的介紹等等<br>多的文字就可以換行繼續寫</p>
</div>
<!-- 按鈕 -->
<!-- 按鈕置中 -->
<div class="btn-group-center">
<a href="#!" class="btn btn-primary btn-lg">訂位請點我</a>
</div>
</div>
</div>
<!-- End reservation -->
style.css:
.reservation {
background-image: url('../images/bg/bg002.jpg');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
}
.reservation .section-intro .title,
.reservation .section-intro .para {
color: #fff;
}
成果顯示:
※ 菜單內容:
index.html:
<!-- Start menu -->
<div class="hero">
<div class="container">
<div class="section-intro">
<!-- 標題 -->
<h2 class="title">MENU</h2>
<!-- 文字說明 -->
<p class="para">
我們提供的服務在這裡有初步的介紹,諸如此類的介紹等等<br>多的文字就可以換行繼續寫</p>
</div>
<!-- 商品列 -->
<div class="menu-list">
<div class="title-bar">
<!-- 標題 -->
<h3 class="title">Coffee & Beverage</h3>
<!-- 按鈕 -->
<a href="#!" class="btn btn-secondary">more</a>
</div>
<!-- 四格商品卡 -->
<div class="row">
<div class="col-1-4">
<!-- 讓圖片有超連結 -->
<a href="#!">
<div class="list-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product005.jpg');"></div>
</div>
<div class="preview">
<h5 class="title">阿拉斯加咖啡</h5>
<h6 class="subtitle">供應條件</h6>
</div>
</div>
</a>
</div>
<div class="col-1-4">
<!-- 讓圖片有超連結 -->
<a href="#!">
<div class="list-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product006.jpg');"></div>
</div>
<div class="preview">
<h5 class="title">阿拉斯加咖啡</h5>
<h6 class="subtitle">供應條件</h6>
</div>
</div>
</a>
</div>
<div class="col-1-4">
<!-- 讓圖片有超連結 -->
<a href="#!">
<div class="list-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product007.jpg');"></div>
</div>
<div class="preview">
<h5 class="title">阿拉斯加咖啡</h5>
<h6 class="subtitle">供應條件</h6>
</div>
</div>
</a>
</div>
<div class="col-1-4">
<!-- 讓圖片有超連結 -->
<a href="#!">
<div class="list-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product008.jpg');"></div>
</div>
<div class="preview">
<h5 class="title">阿拉斯加咖啡</h5>
<h6 class="subtitle">供應條件</h6>
</div>
</div>
</a>
</div>
</div>
</div>
<div class="menu-list">
<div class="title-bar">
<!-- 標題 -->
<h3 class="title">Coffee & Beverage</h3>
<!-- 按鈕 -->
<a href="#!" class="btn btn-secondary">more</a>
</div>
<!-- 四格商品卡 -->
<div class="row">
<div class="col-1-4">
<!-- 讓圖片有超連結 -->
<a href="#!">
<div class="list-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product005.jpg');"></div>
</div>
<div class="preview">
<h5 class="title">阿拉斯加咖啡</h5>
<h6 class="subtitle">供應條件</h6>
</div>
</div>
</a>
</div>
<div class="col-1-4">
<!-- 讓圖片有超連結 -->
<a href="#!">
<div class="list-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product006.jpg');"></div>
</div>
<div class="preview">
<h5 class="title">阿拉斯加咖啡</h5>
<h6 class="subtitle">供應條件</h6>
</div>
</div>
</a>
</div>
<div class="col-1-4">
<!-- 讓圖片有超連結 -->
<a href="#!">
<div class="list-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product007.jpg');"></div>
</div>
<div class="preview">
<h5 class="title">阿拉斯加咖啡</h5>
<h6 class="subtitle">供應條件</h6>
</div>
</div>
</a>
</div>
<div class="col-1-4">
<!-- 讓圖片有超連結 -->
<a href="#!">
<div class="list-item">
<div class="image-container">
<div class="image" style="background-image: url('images/products/product008.jpg');"></div>
</div>
<div class="preview">
<h5 class="title">阿拉斯加咖啡</h5>
<h6 class="subtitle">供應條件</h6>
</div>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
<!-- End menu -->
style.css:
.menu-list {
margin-bottom: 64px;
}
.menu-list:last-child {
margin-bottom: 0;
}
.menu-list .title-bar {
margin-bottom: 24px;
}
.menu-list .title-bar:after {
content: "";
display: block;
clear: both;
}
.menu-list .title-bar .title {
font-size: 24px;
line-height: 40px;
color: #d5a26f;
float: left;
padding-left: 16px;
}
.menu-list .title-bar .title:before {
content: '';
display: inline-block;
width: 4px;
height: 24px;
background-color: #d5a26f;
position: absolute;
top: 50%;
left: 0;
transform: translate(0, -50%);
}
.menu-list .title-bar .btn {
float: right;
padding-top: 8px;
padding-bottom: 8px;
}
.menu-list .list-item .image-container:before {
padding-top: 100%;}
.menu-list .list-item .title {
font-size: 18px;
color: #333;
line-height: 24px;
margin-bottom: 8px;
margin-top: 16px;
}
.menu-list .list-item .subtitle {
font-size: 14px;
color: #d5a26f;
}
成果顯示: