日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > CSS >内容正文

CSS

html水平分隔线样式,CSS生成漂亮的水平分隔线(horizontal rule)设计效果

發布時間:2024/1/23 CSS 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html水平分隔线样式,CSS生成漂亮的水平分隔线(horizontal rule)设计效果 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

HTML代碼中,我們常常使用


標簽來生成水平分隔線,下面分享幾款不同樣式的水平分隔線

相關CSS代碼

/* 漸變 color1 - color2 - color1 */

hr.style-one {

border: 0;

height: 1px;

background: #333;

background-image: linear-gradient(to right, #ccc, #333, #ccc);

}

/* 透明漸變 - color - transparent */

hr.style-two {

border: 0;

height: 1px;

background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));

}

/* 雙線 */

hr.style-three {

border: 0;

border-bottom: 1px dashed #ccc;

background: #999;

}

/* 單線陰影 */

hr.style-four {

height: 12px;

border: 0;

box-shadow: inset 0 12px 12px -12px rgba(0, 0, 0, 0.5);

}

/* 云朵狀 */

hr.style-five {

border: 0;

height: 0; /* Firefox... */

box-shadow: 0 0 10px 1px black;

}

hr.style-five:after { /* Not really supposed to work, but does */

content: "\00a0"; /* Prevent margin collapse */

}

/* 內嵌 */

hr.style-six {

border: 0;

height: 0;

border-top: 1px solid rgba(0, 0, 0, 0.1);

border-bottom: 1px solid rgba(255, 255, 255, 0.3);

}

/* 暈狀 */

hr.style-seven {

height: 30px;

border-style: solid;

border-color: black;

border-width: 1px 0 0 0;

border-radius: 20px;

}

hr.style-seven:before {

display: block;

content: "";

height: 30px;

margin-top: -31px;

border-style: solid;

border-color: black;

border-width: 0 0 1px 0;

border-radius: 20px;

}

/* 文字插入式 */

hr.style-eight {

padding: 0;

border: none;

border-top: medium double #333;

color: #333;

text-align: center;

}

hr.style-eight:after {

content: "gb";

display: inline-block;

position: relative;

top: -0.7em;

font-size: 1.5em;

padding: 0 0.25em;

background: white;

}

/* 分隔線統一樣式 */

hr{

margin: 40px 0;

}

在線演示和調試地址

總結

以上是生活随笔為你收集整理的html水平分隔线样式,CSS生成漂亮的水平分隔线(horizontal rule)设计效果的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。