Flights to Bermuda | Cheap Electronics Store | Credit Cards | Problem Mortgage | Web Advertising
Alignment Problem - CSS/HTML [Archive] - PCMech Forums

PDA

View Full Version : Alignment Problem - CSS/HTML


foolishone
07-29-2005, 11:24 PM
I know it is going to be Saturday soon, so I hope the people that do browse through here on the weekends/late at night can help me.

<A HREF="http://www.getlaughing.com/NewVersion/boating.html" STYLE="text-decoration:none;">Problem Page</A>

The 'Jokes...' line is centered, and so is the title of the joke, but they don't line up. The title is center using HTML and the 'Jokes...' line is centered using text-align:center. How would I go about perfectly centering them both?

^fo

EDIT: I would ultimately like to center the title using CSS, but the text-align: center doesn't work (It's currently on right), so I stuck with the trusty HTML CENTER tag. Why doesn't the CSS work?

ZeratulsAvenger
07-30-2005, 12:45 AM
Isn't the reason they don't line up because of a varying number of charaters to the right of the middle and the left of the middle?

For "Boating" the "t" should be in the direct center, 3 characters to the left, 3 to the right. For the line with "Jokes" "Misc" and "Boating" the set is centered around the "a" in "Miscellaneous," making 5 characters to the right and 7 to the left. A minor difference but that is what is making it slightly "off" center.

A sloppy way to get it to center in a more pleasing fashion("pleasing" for the eyes at least) might be to add some spaces to either side to balance it out. They would go on the left I believe, I'm to tired to think abotu it though. You get the idea though, right? You have 35 characters, so you have 14 to each the left and the right of the centered character, so by making it go to 37 characters with two spaces on the outer left edge, it could help to push the left edge in a little and align the work Miscellaneous in a pretty fashion in relation to the joke title.

I'm pooped, but I think thats it.

foolishone
07-31-2005, 10:48 AM
I think I have it now. I had some word and letter spacing in the title, and none in the top line. So I just added the spacings to the top and they lined up like I wanted them to. They are now the exact same thing except one has a border around it.

Thanks!

»fo