Jquery 定制大勺边框样式-响应灵敏、定制&;动态边框样式-适合高度,自定义边框角-双笔划
有没有办法在CSS或jQuery中创建自定义的独家新闻边框样式 如下图所示: 这是一把小提琴。。。 这对你有用吗Jquery 定制大勺边框样式-响应灵敏、定制&;动态边框样式-适合高度,自定义边框角-双笔划,jquery,html,css,css-shapes,Jquery,Html,Css,Css Shapes,有没有办法在CSS或jQuery中创建自定义的独家新闻边框样式 如下图所示: 这是一把小提琴。。。 这对你有用吗 body { background: #D8D8D8; } .corner { background:white; height:20px; width:20px; position:absolute; } #sw { left: -2px; bottom: -2px; border-radius: 0px 20
body {
background: #D8D8D8;
}
.corner {
background:white;
height:20px;
width:20px;
position:absolute;
}
#sw {
left: -2px;
bottom: -2px;
border-radius: 0px 20px 0px 0px;
border-top: 2px solid white;
border-right: 2px solid white;
background:#D8D8D8;
}
#se {
right: -2px;
bottom: -2px;
border-radius: 20px 0px 0px 0px;
border-top: 2px solid white;
border-left: 2px solid white;
background:#D8D8D8;
}
#nw {
left: -2px;
top: -2px;
border-radius: 0px 0px 20px 0px;
border-bottom: 2px solid white;
border-right: 2px solid white;
background:#D8D8D8;
}
#ne {
right: -2px;
top: -2px;
border-radius: 0px 0px 0px 20px;
border-bottom: 2px solid white;
border-left: 2px solid white;
background:#D8D8D8;
}
.box {
position:relative;
height:200px;
width:200px;
border: solid 2px white;
background:#D8D8D8;
border-radius: 5px -5px 5px 5px;
}
.box2 {
position:relative;
height:160px;
width:160px;
overflow:hidden;
left: 20px;
top: 20px;
}
.box2:before{
content:'';
position:absolute;
left:0;
margin:-20px;
height:40px;
width:40px;
border-radius:100%;
background:#D8D8D8;
box-shadow:160px 0 0 #D8D8D8,
0 160px 0 #D8D8D8,
160px 160px 0 #D8D8D8,
0 0 0 500px white;
}
HTML:
<div class="box">
<div id="ne" class="corner"></div> <!--ne, nw, se, sw, are the corners-->
<div id="nw" class="corner"></div> <!--of first object-->
<div id="se" class="corner"></div>
<div id="sw" class="corner"></div>
<div class="box2"></div> <!--box2 is the inner border object-->
</div>
请注意,对于包围盒,ne
、nw
、se
、sw
为倒角
对于box2
,很难解释发生了什么。我的建议是玩弄长方体阴影的颜色,以及像素位置,以了解长方体阴影是如何产生倒转边界的错觉的
一旦你掌握了窍门,就很容易改变尺寸,使之符合你的喜好。嘿,阿特里亚。欢迎来到SO。请提供一个更有力的描述,说明您希望获得哪些帮助。包含您自己尝试过的所有代码也是有益的。您可能希望查看
边框图像
。最后我让它工作了-这里是细节-嗨Bolboa,你的想法也很好,但似乎很难添加内容。但最后我还是成功了——以下是细节-