Forum Moderators: not2easy

Message Too Old, No Replies

text positioning using % values

new to css for layout so speak slowly

         

fazer600

3:15 pm on Jun 3, 2004 (gmt 0)

10+ Year Member



Up to now I've only been using my stylesheet really for text size, font, background... but think it's time to take the plunge and get rid of the tables I have been using for layout and fully utilise css.

Now currently my table width is set to 75% so it nicely fits in the centre of the page. I've been playing with an online tutorial and

p
{
position: absolute;
top: 200px;
left: 20%
}

looks nice, but then when i also say right:20% it all goes normal with no indenting.

what would be the correct way to have some text a percentage in from the right and left?

isitreal

3:47 pm on Jun 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



margin:1em 20%;

that would put a 1 em top and bottom margin on the paragragh, and a 20% left and right one. Don't use positioning until you have a better grasp of how this stuff works, it causes many problems that are not easy to resolve, so if you can use more basic things like margins or padding to get the job done you'll generally be better off.

fazer600

5:29 pm on Jun 3, 2004 (gmt 0)

10+ Year Member



cheers for that. if anything's likely to cause problems i'll just steer well clear for the time being then.