Mik*_*son 131
我花了更多的时间在这上面,而不是因为显而易见的原因而没有在IE中测试过.话虽如此,它几乎完全相同.
a.boxclose{
float:right;
margin-top:-30px;
margin-right:-30px;
cursor:pointer;
color: #fff;
border: 1px solid #AEAEAE;
border-radius: 30px;
background: #605F61;
font-size: 31px;
font-weight: bold;
display: inline-block;
line-height: 0px;
padding: 11px 3px;
}
.boxclose:before {
content: "×";
}
Run Code Online (Sandbox Code Playgroud)
Cra*_*yne 35
我尝试关闭图标,没有文字
.close-icon
{
display:block;
box-sizing:border-box;
width:20px;
height:20px;
border-width:3px;
border-style: solid;
border-color:red;
border-radius:100%;
background: -webkit-linear-gradient(-45deg, transparent 0%, transparent 46%, white 46%, white 56%,transparent 56%, transparent 100%), -webkit-linear-gradient(45deg, transparent 0%, transparent 46%, white 46%, white 56%,transparent 56%, transparent 100%);
background-color:red;
box-shadow:0px 0px 5px 2px rgba(0,0,0,0.5);
transition: all 0.3s ease;
}Run Code Online (Sandbox Code Playgroud)
<a href="#" class="close-icon"></a>Run Code Online (Sandbox Code Playgroud)
基本思路:对于a.boxclose:
border-radius: 40px;
width:20px;
height 10px;
background-color: #c0c0c0;
border: 1px solid black;
color: white;
padding-left: 10px;
padding-top: 4px;
Run Code Online (Sandbox Code Playgroud)
在关闭框的内容中添加"X".
快速而肮脏,但有效.
小智 9
我试图在所有浏览器中实现看起来一致的东西并且使用可以用css设置样式的svg按钮变得沮丧.
HTML
<svg>
<circle cx="12" cy="12" r="11" stroke="black" stroke-width="2" fill="white" />
<path stroke="black" stroke-width="4" fill="none" d="M6.25,6.25,17.75,17.75" />
<path stroke="black" stroke-width="4" fill="none" d="M6.25,17.75,17.75,6.25" />
</svg>
Run Code Online (Sandbox Code Playgroud)
CSS
svg {
cursor: pointer;
height: 24px;
width: 24px;
}
svg > circle {
stroke: black;
fill: white;
}
svg > path {
stroke: black;
}
svg:hover > circle {
fill: red;
}
svg:hover > path {
stroke: white;
}
Run Code Online (Sandbox Code Playgroud)
http://jsfiddle.net/purves/5exav2m7/
您好,您可以在纯CSS中使用此代码
像这样
CSS
.arrow {
cursor: pointer;
color: white;
border: 1px solid #AEAEAE;
border-radius: 30px;
background: #605F61;
font-size: 31px;
font-weight: bold;
display: inline-block;
line-height: 0px;
padding: 11px 3px;
}
.arrow:before{
content: "×";
}
Run Code Online (Sandbox Code Playgroud)
HTML
<a href="#" class="arrow">
</a>
Run Code Online (Sandbox Code Playgroud)
现场演示http://jsfiddle.net/rohitazad/VzZhU/
编辑:更新了css以匹配您拥有的内容..
HTML
<div>
<span class="close-btn"><a href="#">X</a></span>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.close-btn {
border: 2px solid #c2c2c2;
position: relative;
padding: 1px 5px;
top: -20px;
background-color: #605F61;
left: 198px;
border-radius: 20px;
}
.close-btn a {
font-size: 15px;
font-weight: bold;
color: white;
text-decoration: none;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
153194 次 |
| 最近记录: |