Drag and drop so simple it hurts
https://github.com/bevacqua/dragula
angular-drag-and-drop-lists
http://marceljuenemann.github.io/angular-drag-and-drop-lists/
GRIDSTACK.JS
http://troolee.github.io/gridstack.js/[……]
Drag and drop so simple it hurts
https://github.com/bevacqua/dragula
angular-drag-and-drop-lists
http://marceljuenemann.github.io/angular-drag-and-drop-lists/
GRIDSTACK.JS
http://troolee.github.io/gridstack.js/[……]
@media screen and (max-width: 480px) {
(智慧型手機專用樣式)
}
@media screen and (min-width: 481px) and (max-width: 768px) {
(平板電腦專用樣式)
}
@media screen and (min-width: 769px) {
(電腦專用樣式)
}
區段的順序雖然可以變換,但如果考量CSS的執行效率,則建議從小畫面往大畫面撰寫樣式,這種作法不只寫起來更有效率,也可以提升可讀性。[……]
ul{
[……]
CSS樣式無法覆蓋樣式的解決方案
<style>
.aaa h3{
color:#FF0000;
font-size:50px;
}
.bbb h3{
color:#0AFF00
}
</style>
<div class=”aaa”>
<div class=”bbb”>
<h3>test</h3>
</div>
</div>
改用id
<style>
.aaa .bbb h3{
color:#FF0000;
font-size:50px;
}
#ccc h3{
color:#0AFF00
}
</style>
<div class=”aaa”>
<div class=”bbb” id=”ccc”>
<h3>test</h3>
</div>
</div>
延伸閱讀
http://stackoverflow.com/questions/9956467/overriding-styles-without-important[……]
今天很其怪用transition scale來改變容器大小沒問題
但對圖片就沒有效,上網找了了解決方法
img{
/* Webkit for Chrome and Safari */
-webkit-transform: scale(1, 1); /* This is the scale for the normal size of the image.*/
-webkit-transition-duration: 500ms;
-webkit-transition-timing-function: ease-out;
/* Webkit for Mozila Firefox */
-moz-transform: scale(1, 1);
-moz-transition-duration: 500ms;
-moz-transition-timing-function: ease-out;
/* Webkit for IE( Version: 11, 10 ) */
-ms-transform: scale(1, 1);
-ms-transition-duration: 500ms;
-ms-transition-timing-function: ease-out;
}
img:hover{
/* Webkit for Chrome and Safari */
-webkit-transform: scale(1.2, 1.2); // This is the enlarged size scale of the image.
-webkit-transition-duration: 500ms;
-webkit-transition-timing-function: ease-out;
/* Webkit for Mozila Firefox */
-moz-transform: scale(1.2, 1.2);
-moz-transition-duration: 500ms;
-moz-transition-timing-function: ease-out;
/* Webkit for IE( Version: 11, 10 ) */
-ms-transform: scale(1.20, 1.20);
-ms-transition-duration: 500ms;
-ms-transition-timing-function: ease-out;
}
延伸閱讀:https://drujoopress.wordpress.com/2014/01/31/zoom-effect-using-css3-transition-scale/[……]
2020/03/12 更新發現更簡單的方法,請參考這篇文章https://vector.cool/css-ul-li-horizontal-align-center-only-css/
<div class="main-container"> <div class="fixer-container"> <ul class="list-of-floating-elements"> <li class="floated">Floated element</li> <li class="floated">Floated element</li> <li class="floated">Floated element</li> </ul> </div> </div>
CSS:
<style> ul li{ float:left; margin:0 20px } .main-container { float:left; position:relative; left:50%; } .fixer-container { float:left; position:relative; left:-50%; } </style>
[……]
/* 背景由下往上定位&由右往左定位 */
div{
background-image:url(test.jpg);
background-repeat:no-repeat;
background-position:right 50px bottom 50px;
}[……]
垂直水平居中 ie9+
.child {
position: absolute;
top: 50%; /* position the top edge of the element at the middle of the parent */
left: 50%; /* position the left edge of the element at the middle of the parent */
transform: translate(-50%, -50%); /* This is a shorthand of
translateX(-50%) and translateY(-50%) */
}
沿伸閱讀
[……]