views:

756

answers:

2

I'm in the process of redesigning my blog. I'm trying to implement an outdent of the first letter of the first paragraph of the body text. Where I'm stuck is in getting consistent spacing between the first letter and the rest of the paragraph. Basically, the problem is that there is a huge difference in spacing between a "W" and an "I". The difference is even big between a "W" and an "Y".

Check out these posts for examples:

Starts with a "W"

Starts with a "Y"

Starts with an "I"

Anyone have any bright ideas about how to mitigate the differences? I'd prefer a pure CSS solution, but will resort to JavaScript if I have to.

PS: I haven't even looked at the new design in Internet Explorer or Opera, so please don't bother telling me the whole thing falls apart in those browsers. Cleaning up the display in IE will be the last step of my process. Thanks!

NOTE: Using the accepted solution below, I've fixed the problem. So, visiting the links above ... well, you aren't going to see the problem any more. :-)

A: 

I tried using a fix-width font like 'courier new' and since the characters are more or less the same width it made it a lot less noticeable.

Edit - this font is decent but might only work for windows

p.outdent:first-letter {
    font-family: ms mincho;
    font-size: 8em;
    line-height: 1;
    font-weight: normal;
    float: left;
    margin: -0.1em 0 0 -.55em;
    letter-spacing: 0.05em;
}
mrinject
I'm fine with that, *if* I can find a monospace font that matches pretty closely my body font (Georgia).
Andrew Hedges
+4  A: 

Apply this to p.outdent:first-letter:

margin-left: -800px;
padding-right: 460px;
float: right;

This will position the first letter on the right edge of the paragraph, then shove it left it by more or less the width of the paragraph, then move both the letter and all the padding into the float's large negative margin so the paragraph fits in the margin and doesn't try to wrap around.

Eevee
fyi this doesn't seem to work in IE7 :( (but does work in ff, safari, opera and chrome...)
mrinject
Ah, shame, but not surprising.Given what a quirky and undocumented mystery IE7's box model is, I'd probably just float the letter left in IE7- and let it cut out a corner. The alternative is to waste two days fiddling and then end up doing that anyway.
Eevee
I'll probably just do something like my original solution for IE7 and 8 when I get around to fixing them up. Thanks again!
Andrew Hedges