課程
/前端開發(fā)
/HTML/CSS
/CSS深入理解之border
大神,十字效果怎么通過:before和:after偽元素做出來?
2017-05-07
源自:CSS深入理解之border 3-1
正在回答
li?a{
????????display:?block;
????????width:?100px;
????????height:?80px;
????????border:?1px?solid;
????????box-sizing:?border-box;
????????position:?relative;
????}
????a:before{
????????content:?"";
????????width:?60px;
????????height:?60px;
????????border-top:?10px?solid;
????????position:?absolute;
????????top:?35px;
????????left:?20px;
????a:after{
????????border-left:?10px?solid;
????????top:?10px;
????????left:?45px;
<a href="javascript:alert('xxx');" class="add"></a>
<style>
.add {
width: 60px;
height: 60px;
border: 1px;
border-style: solid;
color: black;
display: inline-block;
left:50px;
top:120px;
}
.add:hover{
color: blue;
.add:after {
content: "";
height: 40px;
border-width: 0 9px 0 0;
position: relative;
top: 9px;
left: -15px;
.add:before {
width: 40px;
border-width: 9px 0 0 0;
top: -6px;
left: 10px;
</style>
.box{color:pink;}
.box:hover{color:blue;}
.box{width: 200px;height: 200px;border:1px solid ;text-align:center;line-height:200px;font-size:0;position:relative;-web-kit-transition: color .25s;}
.box:before{content:"";width: 100px;height: 0;border-top:10px solid;display:inline-block;vertical-align:middle;}
.box:after{content:'';height: 100px;width: 0;border-left:10px solid;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;}
</head>
<body>
<div class="box"></div>
</body>
<a></a>
<style type="text/css">
a{
width: 200px;
height: 200px;
border: 1px solid;
display: block;
a:before{
position: absolute;
width: 100px;
border-top: 10px solid;
margin: 95px 0 0 45px;
a:after{
height: 100px;
border-left: 10px solid;
margin: 45px 0px 0px 90px;
a:hover{
color: red;
舉報
深入講解border使用方法及應(yīng)用,以及如何借助border完成布局
2 回答求教,十字架 是通過 偽類after 樣式里面哪些樣子生成的?
2 回答IE和Chrome的效果一樣啊
4 回答這個復(fù)選框怎么沒有顯示出來?
1 回答老師的ppt是怎么做的啊
1 回答只能實現(xiàn)這種效果 標(biāo)紅的區(qū)域怎么能填充上顏色
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2020-08-12
li?a{
????????display:?block;
????????width:?100px;
????????height:?80px;
????????border:?1px?solid;
????????box-sizing:?border-box;
????????position:?relative;
????}
????a:before{
????????content:?"";
????????width:?60px;
????????height:?60px;
????????border-top:?10px?solid;
????????position:?absolute;
????????top:?35px;
????????left:?20px;
????}
????a:after{
????????content:?"";
????????width:?60px;
????????height:?60px;
????????border-left:?10px?solid;
????????position:?absolute;
????????top:?10px;
????????left:?45px;
????}
2018-09-19
<a href="javascript:alert('xxx');" class="add"></a>
<style>
.add {
width: 60px;
height: 60px;
border: 1px;
border-style: solid;
color: black;
display: inline-block;
left:50px;
top:120px;
}
.add:hover{
color: blue;
}
.add:after {
content: "";
height: 40px;
border-width: 0 9px 0 0;
border-style: solid;
position: relative;
display: inline-block;
top: 9px;
left: -15px;
}
.add:before {
content: "";
width: 40px;
border-width: 9px 0 0 0;
border-style: solid;
position: relative;
display: inline-block;
top: -6px;
left: 10px;
}
</style>
2017-10-30
<style>
.box{color:pink;}
.box:hover{color:blue;}
.box{width: 200px;height: 200px;border:1px solid ;text-align:center;line-height:200px;font-size:0;position:relative;-web-kit-transition: color .25s;}
.box:before{content:"";width: 100px;height: 0;border-top:10px solid;display:inline-block;vertical-align:middle;}
.box:after{content:'';height: 100px;width: 0;border-left:10px solid;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;}
</style>
</head>
<body>
<div class="box"></div>
</body>
2017-05-08
<a></a>
<style type="text/css">
a{
width: 200px;
height: 200px;
border: 1px solid;
position: relative;
display: block;
}
a:before{
content: "";
position: absolute;
width: 100px;
border-top: 10px solid;
margin: 95px 0 0 45px;
}
a:after{
content: "";
position: absolute;
height: 100px;
border-left: 10px solid;
margin: 45px 0px 0px 90px;
}
a:hover{
color: red;
}
</style>