【发布时间】:2015-05-07 12:05:45
【问题描述】:
我目前正在通过 wordpress 开发在线商店。一切正常,现在我想给我的页面一个自定义边框(倒圆角)并找到它的 css 代码,如下所示:
css:
body {
background-color: #fff;
}
.wrapper {
overflow:hidden;
width:200px;
height:200px;
}
div.inverted-corner {
box-sizing:border-box;
position: relative;
background-color: #3e2a4f;
height: 200px;
width: 200px;
border: solid grey 7px;
}
.top, .bottom {
position: absolute;
width: 100%;
height: 100%;
top:0;
left:0;
}
.top:before, .top:after, .bottom:before, .bottom:after{
content:" ";
position:absolute;
width: 40px;
height: 40px;
background-color: #fff;
border: solid grey 7px;
border-radius: 20px;
}
.top:before {
top:-35px;
left:-35px;
}
.top:after {
top: -35px;
right: -35px;
box-shadow: inset 1px 1px 1px grey;
}
.bottom:before {
bottom:-35px;
left:-35px;
}
.bottom:after {
bottom: -35px;
right: -35px;
box-shadow: inset 1px 1px 1px grey;
}
html:
<div class="wrapper">
<div class="inverted-corner">
<div class="top"> </div>
<h1>Hello</h1>
<div class="bottom"> </div>
</div>
</div>
我重命名了这些类,以免与主题的现有 css 类发生冲突。它工作正常,如下所示:my site。现在的问题是,我不能再与网站交互,没有链接,没有悬停效果。似乎自定义 css 覆盖了实际站点。你有什么建议我可能做错了吗?
附:我编辑了 header.php,使倒角 div 和顶部 div 位于页面包装器 div(网站内容)的正下方,在 footer.php 中,我编辑了顶部 div 和倒角 div 关闭在页面正上方 -包装器 div 关闭。
【问题讨论】:
-
DIV
.bottom-corner与您的所有站点重叠。设置pointer-events: none;可以解决此问题,但旧版浏览器不支持此属性。 -
@Rob 你的意思是除了IEcaniuse.com/#feat=pointer-events
标签: javascript jquery css wordpress wordpress-theming