开发者

Creating 4 concentric boxes with different background colors – only 2 of them appear

Why can't I show a box within a box, within a box, within a box, with 4 different background colors, 4 different div ids, I don't want to specify a width, I only see two colors when I should see 4?

Thanks for your help - Matthew

Whey can't I show tags? This is kind of co开发者_开发知识库mplicated!!!!


A block element will fill out the dimensions of its parent element unless there are explicit widths set or there is padding inside a containing element. So if you have divs inside divs, make sure you have padding in the containing divs set (if you're not going to set explicit widths)


you must set some min-height and min-width style and then you can give proper style each div

DEMO


You need to specify a height. The div could be 0x0 and that's probably not what you want.

Below is an example of what we think you want but I specified a height and width. http://jsfiddle.net/8T6KG

Update: As recommended, I removed the width and height: http://jsfiddle.net/8T6KG/3/


can you paste some sample code? plus, you can try setting the position to relative. And I think the outer most div needs to have some height and width set.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜