我正在尝试在右侧中心创建一个带箭头的框。到目前为止,我有以下代码,但它没有显示和想法?
CSS:
.pageHelp{
float:right;
margin:10px 20px 0 0;
width:85px;
height:25px;
border-radius:3px;
background-color:#354E69;
}
.pageHelp p{
color:#000;
padding:5px;
text-align:center;
}
.pageHelp .arrow{
width:0;
height:0;
border-top:3px solid transparent;
border-bottom:3px solid transparent;
border-left:3px solid #354E69;
}
HTML:
<div class="pageHelp arrow"><p>In Page Help</p></div>
答案 0 :(得分:5)
您应该查看css3arrowsplease
答案 1 :(得分:2)
以下内容对您有用:
<强> CSS:强>
.pageHelp{
float:right;
margin:10px 20px 0 0;
width:85px;
height:50px;
border-radius:3px;
background-color:#354E69;
position:relative;
}
.pageHelp p{
color:#000;
padding:5px;
text-align:center;
}
.pageHelp:after {
content: ' ';
height: 0;
position: absolute;
left:10px;
width: 0;
border: 10px solid transparent;
border-left-color: #354E69;
left: 100%;
top: 50%;
margin-top: -10px;
}
<强> HTML:强>
<div class="pageHelp"><p>In Page Help</p></div>
查看以下博文,了解其工作原理:http://www.yuiblog.com/blog/2010/11/22/css-quick-tip-css-arrows-and-shapes-without-markup/