顯示具有 Bootstrap 3 標籤的文章。 顯示所有文章
顯示具有 Bootstrap 3 標籤的文章。 顯示所有文章

星期五, 8月 31, 2018

[Bootstrap3] Bs3各種垂置置中

記錄每次寫一次忘一次的bs3垂直置中

http://jasonlung.logdown.com/posts/2016/07/23/how-to-bootstrap-content
https://codepen.io/hashem/pen/zwJaE
https://blog.iphpo.com/bootstrap-3-%E8%AE%93%E7%89%A9%E4%BB%B6%E5%9E%82%E7%9B%B4%E7%BD%AE%E4%B8%AD%E7%9A%84%E6%96%B0%E6%96%B9%E6%B3%95/

星期六, 11月 25, 2017

[Bootstrap 3] 在行動裝置重新排序Column

剛好做客戶有遇到,要在手機layout的改變column的位置,
簡單來說就左右調換,其實bootstrap裡面就有支援行 re-ordering了。
可以參考以下範例

https://codepen.io/Schmalzy/pen/iJdgD

星期三, 11月 08, 2017

[bootstrap 3] 如何簡單快速覆寫bootstrap的樣式

如果懶的用less來重build bootstrap的樣式的話,
通常你會在link下面多引用一個你要覆寫bootstrap.min.css的客製化樣式。
但你會發現有可能覆寫失敗,
有些人會建議使用大絕招!important 屬性,
找到stackoverflow另一篇建議:
https://stackoverflow.com/questions/8084964/how-to-overwrite-styling-in-twitter-bootstrap/20542297#20542297
因為css選擇器有權重的特性,
可以加上id的名稱去覆寫,這樣就不失彈性啦!

例如自訂一個nav-customer來覆寫nav的相關設定
header #nav-customer{
background-color: rgba(0, 0, 0, 0.6);
}

參考
https://stackoverflow.com/questions/8084964/how-to-overwrite-styling-in-twitter-bootstrap/20542297#20542297

星期日, 10月 02, 2016

[Bootstrap] 讓Modal滿版的樣式修正

為了想讓手機RWD的modal滿版效果感覺比較好,找到了下面的sample。

測試環境的bootstrap 3





.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
}

.modal-dialog {
  position: fixed;
  margin: 0;
  width: 100%;
  height: 100%;
  padding: 0;
}

.modal-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 2px solid #3c7dcf;
  border-radius: 0;
  box-shadow: none;
}

.modal-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 50px;
  padding: 10px;
  background: #6598d9;
  border: 0;
}

.modal-title {
  font-weight: 300;
  font-size: 2em;
  color: #fff;
  line-height: 30px;
}

.modal-body {
  position: absolute;
  top: 50px;
  bottom: 60px;
  width: 100%;
  font-weight: 300;
  overflow: auto;
}

.modal-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 60px;
  padding: 10px;
  background: #f1f3f5;
}
https://codepen.io/yewnork/pen/Kpaqeq

星期三, 3月 02, 2016

[Bootstrap 3] 變更modal overlay的背景色方法

本文記錄一下如何修改bootstrap modal overlay的背景色
To change the color via:

CSS

Put these styles in your stylesheet after the bootstrap styles:
.modal-backdrop {
   background-color: red;
}

Less

Changes the bootstrap-variables to:
@modal-backdrop-bg:           red;

Sass

Changes the bootstrap-variables to:
$modal-backdrop-bg:           red;

星期日, 4月 12, 2015

[Bootstrap 3] 替下拉式選單加上三角形的對話框圖

如果想讓bootstrap的下拉選單多了一個三角形的圖案的視覺效果, 可以加入二個虛擬元素 before與after,如下所示:

.dropdown-menu:before {
  position: absolute;
  top: -7px;
  left: 9px;
  display: inline-block;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #ccc;
  border-left: 7px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.2);
  content: '';
}

.dropdown-menu:after {
  position: absolute;
  top: -6px;
  left: 10px;
  display: inline-block;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #ffffff;
  border-left: 6px solid transparent;
  content: '';
}

效果

其他你感興趣的文章

Related Posts with Thumbnails