日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

css 科技 边框_纯css制作带三角的边框(附效果图)

發布時間:2024/3/26 48 豆豆
生活随笔 收集整理的這篇文章主要介紹了 css 科技 边框_纯css制作带三角的边框(附效果图) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

首先附上效果圖:

以上的效果完全是用 css 來實現的,那么是怎么實現的呢?

我們知道 html 中有一些特殊的字符,具體的請點擊 HTML特殊字符大全。

通過特殊字符,利用 css 中的 margin 或者 position 方法完全可以實現以上效果。

復制代碼代碼如下:

字符制作三角邊框

*{margin:0;padding:0;}

body{font-family:SimSun;}

h1{text-align:center;}

.demo1{width:300px;margin:20px auto;border:1px solid red;height:100px;}

.demo1 em,.demo1 span{display:block;width:30px;height:16px;font-size:30px;overflow:hidden;_position:relative;margin-left:10px;}

.demo1 em{margin-top:-16px;color:red;font-style:normal;}

.demo1 span{margin-top:-14px;color:white;}

.demo2{width:300px;border:1px solid #F00;height:100px;position:relative;margin-left:auto;margin-right:auto;}

.demo2 em,.demo2 span{font-style:normal;font-size:30px;position:absolute;left:-16px;top:40px;color:red;}

.demo2 span{left:-14px;color:white;}

demo1 是用 margin 方法

demo2 是用 position 方法

PS:除了用字符可以實現三角,我們還可以利用 border 來實現三角。具體地址:https://www.jb51.net/css/33748.html

總結

以上是生活随笔為你收集整理的css 科技 边框_纯css制作带三角的边框(附效果图)的全部內容,希望文章能夠幫你解決所遇到的問題。

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