0
我发现了一个潜在的解决方案来解决堆栈溢出问题,但它似乎并没有为我工作。我希望图像出现在p.choke之前和之后,所以在顶部和底部。我正在使用以下CSS:p标记之前和之后的背景图片
p.choke:before{
content:" ";
background-image:url(...);
background-position:center top;
}
p.choke:after{
content:" ";
background-image:url(...);
background-position:center bottom;
}
p.choke{
background-image:url(...);
background-repeat:no-repeat;
background-position:center top;
width:75%;
line-height:2em;
text-align:center;
margin:0 auto;
color:#009245;
padding:1em 0;
}
图像应该出现在我的段落标记的顶部和底部,对不对?我读过其他有这个问题的人,这是他们使用的语法。为什么我的形象只出现在顶部?
http://dev.myfishermanscove.com/resort-services/hours-and-rates/
该页面中的哪些元素是您试图将此影响应用于? – leigero
我认为你需要为你的伪元素设置一个宽度和高度,以便让html知道你的图像的大小 – Andrew