Click to See Complete Forum and Search --> : positioning of divs in general


ketanco
02-28-2009, 09:29 PM
Hello,
1) If I want to place a div withing another div, how can I align the second divs position with respect to the parent div? What is the css command for that?
2) As I was told that the tables are not a good way to position elements, I decided to position divs inside parent div...So I need to know how can I position the smaller divs in relation to the parent div....Is my thinking correct first of all?
3) Also, this must be a very basic question but, in general when desinging a website, do you do one parent div, and then smaller divs inside of that parent div nested as applicable, is that how this works? So lets say the whole background of your webpage would be the backgorund of the parent div, and then as you prefer you insert more backgrounds for any smaller divs inside...Is this how this is done / most logical or common way?

Fang
03-01-2009, 01:39 AM
Positioning of child elements can be achieved with margin, padding, float, display or position properties. Which you use depends on the required result.
As to your last question; basically yes.