人生好難啊~ 漂亮前端很難啊~ 符合雇主的前端更難啊~ 這可能是很多前端工程師的苦痛,☆然我只是做做小網站的前端,但是因為雇主一直給我改需求,搞到我比設計師還忙阿QQ,我說大哥阿!你能不能跟設計師橋好在跟我說啊!他X的不要一直改需求阿!!!!!!
好啦,抱怨就到這裡,這次來講講『我都會你沒理由不會的』前端美觀框架-Bootstrap,裡面其實是CSS + jQuery,有很多寫好的套件可以直接使用!
本次的內容皆是截至Bootstrap中文版,本篇只會介紹我覺得常用的,看完我的文章的想更瞭解可以去以下連結看~
雖然我們團隊在今天失敗了,小編還是要跟大家宣傳一下,我們團員的文章都相當不錯,覺得小編文章無聊的可以去看看喔~~
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<div class="container">
<div class="row">
<div class="col-3"></div>
<div class="col-3"></div>
<div class="col-3"></div>
</div>
</div>
也可寫成
<div class="container">
<div class="row">
<div class="col-3 offset-3"></div>
<div class="col-3"></div>
</div>
</div>
<button type="button" class="btn btn-outline-primary">Primary</button>
<button type="button" class="btn btn-outline-secondary">Secondary</button>
<button type="button" class="btn btn-outline-dark">Dark</button>
<div id="Carousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#Carousel" data-slide-to="0" class="active"></li>
<li data-target="#Carousel" data-slide-to="1"></li>
<li data-target="#Carousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="圖片連結1" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="圖片連結2" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="圖片連結3" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#Carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#Carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</nav>
<img src="..." class="img-fluid" alt="Responsive image">
<img src="..." class="rounded float-left" alt="圖片置右">
<img src="..." class="rounded float-right" alt="圖片置左">
<div class="text-center">
<img src="..." class="rounded" alt="圖片置中">
</div>
(再次申明: 本篇程式碼有些參考於Bootstrap中文版,如果有違反版權請告知小編)