Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Box Positioning using CSS

Status
Not open for further replies.

djabell

Instructor
Apr 9, 2001
44
0
0
GB
I want to have a simple layout with a title box, a content box and a footer box, with a small space between each. The result I'm looking for is the title box at the top, the content box in the middle and just below the content box, a footer box. I've positioned the title box and content box easily enough using absolute positioning, as I know the dimensions of the graphic in the title box. Is there a way to dynamically find the dimensions of a box within css, or is there some other obvious way that I'm missing (I'm fairly new to CSS, so be gentle!!)?
 
No, there is no way to find out the size of a dynamic box through CSS, you could use Javascript for that. However, I would suggest you use relative positioning, which will place the boxes after the previous ended. Relying too much on javascript is not good and sites done entirely in absolute positioning usually have many problems.
 
I take it you already have the content and are placing in on that page, that's why you want to position everything??

You can not use absolute positioning and do it. It's impossible(i tried it for weeks) what you can do it use relative positioning. Read here for code:


if you use relative, you can have the middle section grow as needed with basic "height=100%" code, and use relative css to move your footer or middle section down 10 pixels from their normal position. This would make a small space and solve your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top