开发者

Cross-browser Text-indenting

Is the a uniform cross-browser text-indenting technique ?

I use text-indenting to hide text and replace with 开发者_开发知识库images quite alot. I do something like the following: text-indent: -30000px;

But, on Chrone, IE, and Oprah the text is indented out so it's not visible but the width of the element is still as wide at the text. Ordinarily, this would not be a problem except tah it looks one way on FF and entirely different on other browsers.


You most likely need to specify the width of the element as well.

If you're doing that and it's still not working, could you provide some sample code for us to take a look at?


I also use this technique at times to show images, but in all cases I'm also setting the width on the element to match the image swap. If you set the width you'll get consistent sizing of the block across most browsers * cough IE cough *.

If you're hiding the text but also need to rely on the width of the rendered text for spacing I'd question if you're using the right technique for that particular situation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜