Color “transparent” not working

那年仲夏 提交于 2019-12-02 20:39:51
Juan

if what you're trying to do is show the image as background and not showing the text use

font-size:0px

it works!

Arsenal Fanatic

what about using line-height

line-height:0;

it worked in my case.

Poru

I get it: With the correct padding and a zero font-size! Set the padding-left value to be one pixel beyond the image width.

If this doesn't work in Internet Explorer 8

font-size: 0;

make sure you're using a valid doctype:

<!DOCTYPE html>
tbela99

This should work. If it doesn't add display: block or inline-block

.transparent {
    text-indent: 100%;
    overflow: hidden;
    white-space: nowrap;
}

I think no versions of IE support color: transparent Perhaps you could try to do it with jQuery or something like that.

I assume you already fixed this, but lately i've used a very large line-height, when text-indent is giving me layout problems, combined with overflow: hidden to hide the text.

IE doesn't support li:after consistently. Which IE are you talking about? IE6? IE7? Both?

For me color:transparent was not working in IE8, and it was showing text with default color. I used visibility:hidden; for IE8 only as the text was not required to display.

Hope this help in case, if the element is not required to display.

I see you're using a PNG as your background image. Normally, if you're using IE 6, there is a fix for PNG transparency (http://www.twinhelix.com/css/iepngfix/). Even so, this will not work with background-images. So if you're using IE 6, there really isn't a fix.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!