catterfeld
01-16-2004, 04:10 AM
I've trawled through the archives but I've been unable to find an answer to what seems like should be a very common question.
I need to centre the content on my page both horizontally and vertically, but I do not want to have to specify the height and width of the <div>. I have used Pyro's example previously <http://www.infinitypages.com/research/verticalcentereddiv.htm>, but his example requires a predetermined height and width of the <div> which I don't have.
I want to centre three types of <div> with at most two style sheets. The first has a fixed width, with height dependant on the text content of the box. The second and third types are either height 420px and width 300px or height 300px and width 420px, but these must share the same style sheet.
Can anyone offer me advice on how I can get these divs to dynamically centre on the page without predetermined heights and widths?
Many thanks for your help,
Catto
I need to centre the content on my page both horizontally and vertically, but I do not want to have to specify the height and width of the <div>. I have used Pyro's example previously <http://www.infinitypages.com/research/verticalcentereddiv.htm>, but his example requires a predetermined height and width of the <div> which I don't have.
I want to centre three types of <div> with at most two style sheets. The first has a fixed width, with height dependant on the text content of the box. The second and third types are either height 420px and width 300px or height 300px and width 420px, but these must share the same style sheet.
Can anyone offer me advice on how I can get these divs to dynamically centre on the page without predetermined heights and widths?
Many thanks for your help,
Catto