Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
horizontal align with css?
Name: tImmaY Date: July 7, 2004 at 00:34:37 Pacific OS: Windows XP Pro SP1 CPU/Ram: AMD Athlon XP 2400+/512 m
Comment:
hey, i've done kind of a lot with CSS but i've never come across this, so i was wondering if there was a way that you could horizontally align something (like the information within a table data cell) in css? besides like padding-left and padding-right..?
Name: jam14online Date: July 7, 2004 at 07:54:35 Pacific
Reply:
For your specific example, you can use the text-align property to center the information in that cell.
The best method I have found is to make an element a percentage width, for example 65%. Then you can use the margin-left property and set it to 17.5%. This is half of what is left (100 - 65 = 35 / 2 = 17.5), i.e. enough to have an equal margin on each side.
I hope this helps,
James
0
Response Number 2
Name: andyhargreaves Date: July 7, 2004 at 11:08:16 Pacific
Reply:
Hi
I use text-align: center in CSS and it works very well. Seems simpler to me than using margins.
0
Response Number 3
Name: tImmaY Date: July 13, 2004 at 00:49:14 Pacific
Reply:
thanks james, thats a good idea.. i've used something similar to that to align tables right.
thanks andy but that doesn't quite accomplish what i was thinking to do..
Summary: well the thing is, i cant change the border colors of the tables using css at all on the firefox browser. so if any of you know a way of doing that with css, that'd be great FBI Agent AIM: EliteAssass...
Summary: the whitespace isn't olny at the bottom. i have 1024*768 with firefox, and a horizontal scrollbar shows up, but when scrolled will only reveal a big whitespace at the right. I don't know why that happ...
Summary: I'd like to right align buttons created using the <button> tag with CSS. I had this in my css file but it didn't work: button { position:right } How do you specify the length of your buttons too? ...