成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

css3實現(xiàn)尖角的方法

這篇文章給大家分享的是有關css3實現(xiàn)尖角的方法的內(nèi)容。小編覺得挺實用的,因此分享給大家做個參考。一起跟隨小編過來看看吧。

企業(yè)建站必須是能夠以充分展現(xiàn)企業(yè)形象為主要目的,是企業(yè)文化與產(chǎn)品對外擴展宣傳的重要窗口,一個合格的網(wǎng)站不僅僅能為公司帶來巨大的互聯(lián)網(wǎng)上的收集和信息發(fā)布平臺,創(chuàng)新互聯(lián)面向各種領域:酒樓設計成都網(wǎng)站設計、營銷型網(wǎng)站建設解決方案、網(wǎng)站設計等建站排名服務。


css3做尖角的方法:首先創(chuàng)建一個HTML示例文件;然后確定尖角的位置;最后通過給指定div設置屬性為“top:6px;left:-3px;border-top:0px;border-bottom...”來實現(xiàn)尖角效果即可。

尖角在上面

代碼:

<html>
<head>
<title>尖角p</title>
<style type="text/css">
#top
{
  width:400px;
  height:250px;
  border:3px solid;   /* 邊框?qū)挾葹?px */
  position:relative;
}
.sp1,.sp2
{
  display:block;
  height:0px;
  width:0px;
  position:absolute;
  font-size:0;
  line-height:0;
}
.sp1
{
  top:-9px;    /* 它的絕對值加上span的邊框?qū)挾鹊扔趐邊框?qū)挾鹊?倍 */
  left:40px;   /* 它來確定尖角的位置 */
  border-top:0px;
  border-bottom:6px solid black;  /* 注意顏色的變化 */
  border-right:6px solid white;
  border-left:6px solid white;
}
.sp2
{
  top:6px;  /* 是自身邊框?qū)挾鹊?倍 */
  left:-3px; /* 是自身邊框?qū)挾鹊?1倍  */
  border-top:0px;
  border-bottom:3px solid white;
  border-right:3px solid black;
  border-left:3px solid black;
}

</style>
</head>

<body>
<p id="top">
<span class="sp1">
<span class="sp2"></span>
</span>
</p>
</body>

</html>


尖角在下面

代碼:

<html>
<head>
<title>尖角p</title>
<style type="text/css">
#bottom
{
  width:400px;
  height:250px;
  border:3px solid;   /* 邊框?qū)挾葹?px */
  position:relative;
}
.sp1,.sp2
{
  display:block;
  height:0px;
  width:0px;
  position:absolute;
  font-size:0;
  line-height:0;
}
.sp1
{
  bottom:-9px;    /* 它的絕對值加上span的邊框?qū)挾鹊扔趐邊框?qū)挾鹊?倍 */
  left:40px;   /* 它來確定尖角的位置 */
  border-bottom:0px;
  border-top:6px solid black;  /* 注意顏色的變化 */
  border-right:6px solid white;
  border-left:6px solid white;
}
.sp2
{
  bottom:6px;  /* 是自身邊框?qū)挾鹊?倍 */
  left:-3px; /* 是自身邊框?qū)挾鹊?1倍  */
  border-bottom:0px;
  border-top:3px solid white;
  border-right:3px solid black;
  border-left:3px solid black;
}

</style>
</head>

<body>
<p id="bottom">
<span class="sp1">
<span class="sp2"></span>
</span>
</p>
</body>

</html>


尖角在左邊

代碼:

<html>
<head>
<title>尖角p</title>
<style type="text/css">
#left
{
  width:400px;
  height:250px;
  border:3px solid;   /* 邊框?qū)挾葹?px */
  position:relative;
}
.sp1,.sp2
{
  display:block;
  height:0px;
  width:0px;
  position:absolute;
  font-size:0;
  line-height:0;
}
.sp1
{
  left:-9px;    /* 它的絕對值加上span的邊框?qū)挾鹊扔趐邊框?qū)挾鹊?倍 */
  top:40px;   /* 它來確定尖角的位置 */
  border-left:0px;
  border-top:6px solid white;  /* 注意顏色的變化 */
  border-right:6px solid black;
  border-bottom:6px solid white;
}
.sp2
{
  left:6px;  /* 是自身邊框?qū)挾鹊?倍 */
  top:-3px; /* 是自身邊框?qū)挾鹊?1倍  */
  border-left:0px;
  border-top:3px solid black;
  border-right:3px solid white;
  border-bottom:3px solid black;
}

</style>
</head>

<body>
<p id="left">
<span class="sp1">
<span class="sp2"></span>
</span>
</p>
</body>

</html>


尖角在右邊

代碼:

<html>
<head>
<title>尖角p</title>
<style type="text/css">
#right
{
  width:400px;
  height:250px;
  border:3px solid;   /* 邊框?qū)挾葹?px */
  position:relative;
}
.sp1,.sp2
{
  display:block;
  height:0px;
  width:0px;
  position:absolute;
  font-size:0;
  line-height:0;
}
.sp1
{
  right:-9px;    /* 它的絕對值加上span的邊框?qū)挾鹊扔趐邊框?qū)挾鹊?倍 */
  top:40px;   /* 它來確定尖角的位置 */
  border-right:0px;
  border-top:6px solid white;  /* 注意顏色的變化 */
  border-bottom:6px solid white;
  border-left:6px solid black;
}
.sp2
{
  right:6px;  /* 是自身邊框?qū)挾鹊?倍 */
  top:-3px; /* 是自身邊框?qū)挾鹊?1倍  */
  border-right:0px;
  border-top:3px solid black;
  border-bottom:3px solid black;
  border-left:3px solid white;
}

</style>
</head>

<body>
<p id="right">
<span class="sp1">
<span class="sp2"></span>
</span>
</p>
</body>

</html>

感謝各位的閱讀!關于css3實現(xiàn)尖角的方法就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

網(wǎng)站名稱:css3實現(xiàn)尖角的方法
轉(zhuǎn)載來于:http://jinyejixie.com/article46/ijgheg.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、App開發(fā)、小程序開發(fā)、云服務器、外貿(mào)建站域名注冊

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作
涞源县| 盐边县| 千阳县| 星子县| 合作市| 广州市| 洛川县| 巴青县| 叙永县| 吴川市| 霍邱县| 淮南市| 吴旗县| 禹城市| 玉树县| 栾川县| 宜兰市| 汤阴县| 宕昌县| 海兴县| 永泰县| 恩施市| 巴塘县| 碌曲县| 通道| 吉木乃县| 桐城市| 肇东市| 镇江市| 乌拉特后旗| 和政县| 米林县| 梅州市| 汉川市| 如皋市| 辽阳市| 阳原县| 法库县| 抚顺市| 丘北县| 连云港市|