DIV relative to centre ?

C

chris

how would i position something on a page using the <div tag but have it
relative to the center

ie i want it 200px to the left of centerregardless of the browser window
size?

also does anyone know where i can fid a FULL list of all DIV properties
thanks in advance
 
R

Randy Webb

chris said:
how would i position something on a page using the <div tag but have it
relative to the center

Use CSS.
ie i want it 200px to the left of centerregardless of the browser window
size?

Use CSS.
also does anyone know where i can fid a FULL list of all DIV properties

Yes, I know. Oh? You wanted the answer? Its in the specs at www.w3c.org,
happy hunting.
thanks in advance

Welcome.
 
J

Jim Royal

chris <[email protected]> said:
how would i position something on a page using the <div tag but have it
relative to the center

ie i want it 200px to the left of centerregardless of the browser window
size?

There are a number of ways. one would be to apply a text-align:center
to the parent of the DIV, and then a margin-left of 200 pixels to the
DIV itself.

Or, you could set the margins of the DIV to auto, but this doesn't work
in every browser without a hack.
also does anyone know where i can fid a FULL list of all DIV properties
thanks in advance

Bone up on your CSS.

http://www.oreilly.com/catalog/csspr2/
 
L

Leif K-Brooks

Jim said:
There are a number of ways. one would be to apply a text-align:center
to the parent of the DIV, and then a margin-left of 200 pixels to the
DIV itself.

Or, you could set the margins of the DIV to auto, but this doesn't work
in every browser without a hack.

And text-align:center on the parent doesn't work in half-decent
browsers. The latest version of IE works with margin:auto, so it
shouldn't be a problem.
 
M

Mark Preston

Leif said:
And text-align:center on the parent doesn't work in half-decent
browsers. The latest version of IE works with margin:auto, so it
shouldn't be a problem.

I may be slightly - but only slightly - biased about it, but mentioning
Microsoft's IE browser as a "half-way decent browser" seems rather
strange, given that it isn't even half-way decent. Do, please, remember
that the most senior security authorities on the internet AND in the US
security agancies have both advised people to seriously consider
switching to something different!
 
D

Daniel

Mark Preston said:
I may be slightly - but only slightly - biased about it, but mentioning
Microsoft's IE browser as a "half-way decent browser" seems rather
strange, given that it isn't even half-way decent. Do, please, remember
that the most senior security authorities on the internet AND in the US
security agancies have both advised people to seriously consider
switching to something different!



Why do you want a half-decent browser anyway? Why not strive for
perfection? My current favorite is Firefox .9, in my continuing quest
for perfect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top