简体   繁体   English

背景色渗入透明色

[英]Background color is leaking into transparent color

I have managed to get the background-border transparency working perfectly but now I can't get the content to appear white by any means without it overlapping into the border image. 我设法使背景边框透明性工作得很好,但是现在我无法在没有重叠边框图像的情况下以任何方式使内容显示为白色。

Here is what I have: http://gigadra.in/ 这是我所拥有的: http : //gigadra.in/

What I need is this but where the text is (the content) I need the background to be white 我需要的是这个,但是文本(内容)在哪里,我需要背景为白色

I have tried: -Setting background color (simply doesn't work as it sets the border color too.) -using a repeating bg image (the transparency is still there but the image loads partly over the border) -using span to make the text background white (this would work but it only covers around the exact area of the text leaving some of the background transparent and come of it white. 我试过了:-设置背景颜色(因为它也设置了边框颜色,所以根本不起作用。)-使用重复的bg图像(透明度仍然存在,但是图像部分加载在边框上)-使用跨度使文本背景为白色(这可以工作,但仅覆盖文本的确切区​​域,而使某些背景透明而变成白色。

here is my code: 这是我的代码:

.blog {
border-width: 27px;
-moz-border-image: url(divborder.png) 27 stretch;
-webkit-border-image: url(divborder.png) 27 stretch;
-o-border-image: url(divborder.png) 27 stretch;
border-image: url(divborder.png) 27 stretch;
font-family: pokemon;
font-size: 9px;
padding: 0px;
margin: 20px;
border-color: rgba(128,128,128,0.3);

}

oddly enough it loads fine in Dreamweaver, 奇怪的是,它在Dreamweaver中可以很好地加载,

thanks again guys! 再次感谢你们!

I think you just need to put your post content into div tag with some class ( post-content for example) and set background color for it. 我认为您只需要将您的帖子内容放入带有某些class div标签中(例如, post-content ),并为其设置背景颜色。

Here's the fiddle: http://jsfiddle.net/qgg9j/ (check out the last post) 这是小提琴: http : //jsfiddle.net/qgg9j/ (查看最后一篇文章)

HTML HTML

<div class="blog">
    <div class="content_wrapper">
        <h1>text</h1>    
    </div>    
</div>

CSS CSS

.content_wrapper{
    background: #fff;
    padding: 1px;
}
.blog {
    border-width: 27px;
    -moz-border-image: url(divborder.png) 27 stretch;
    -webkit-border-image: url(divborder.png) 27 stretch;
    -o-border-image: url(divborder.png) 27 stretch;
    /* border-image: url(divborder.png) 27 stretch;  Remove this line */
    font-family: pokemon;
    font-size: 9px;
    padding: 0px;
    margin: 20px;
    border-color: rgba(128,128,128,0.3);
}

Its a dirty fix but it works 它是一个肮脏的修复程序,但是可以正常工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM