Name: tImmaY Date: July 7, 2004 at 00:34:37 Pacific Subject: horizontal align with css? 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..?
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.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE