CSS: Clipping Large Text

Status
Not open for further replies.

Joystickit

Ars Tribunus Angusticlavius
6,571
Howdy folks... I'm having a bit of a problem with some CSS stuff. Basicaly what I want to do is put a large word (in terms of pt or px size) in a div and clip it off. This sounds simple in theory but difficult in practice. It works fine in IE on the PC, but not Mozilla for any platform or IE on the mac, which I do need to support.

To get it to work in IE, I put two divs inside each other, one positioned way outside the other one so that I can get a swath of the text where it is wide enough and not just the whitespace at the top.

See it in practice here.
Here is what I was playing around with:

Code:
<!-- this works in IE PC -->  
<div style="position:absolute;overflow:hidden;height:20px;width:800px;">
<div style="position:absolute;top:-350px;">
<p style="font-size:600px;top:-40px;">testing</p>
</div>
</div>

<!-- this doesn't work in anything -->
<p style="clip:rect(25px,125px,125px,25px);font-size:200px;overflow:hidden;">Hello</p>


As you can see, I was trying to use the clip on the second example,
I've had no problems using the clip property on images, but it is
supposed to work for other elemnts as well. I've tried a bunch of
other things and the top example is the only thing I've gotten to
work at all so far.

Anyone have any tips or can tell me what I'm doing wrong?
 
Status
Not open for further replies.