开发者

Css & Html, Whats the css for a div id inside div id

Trying to put a div id inside another div id, but having problems. The html is simple enough, a div inside a div with two closing divs beside each other, but I can't for the life of me get the css correct. I feel really silly asking such a newbie question, please help. I want the css to display the html with the outer container with a background color that shows around the outside of the inner container.

Can you give me an example of the css required for开发者_运维知识库 this? Thanks for your help, -Matthew


Here you have example on JSFiddle:

http://jsfiddle.net/JXUeF/1/


if your html looks like this (this is how i understood your description):

<div id="outer">
  <div id="inner">
    some content here
  </div>
</div>

your css should look like this:

#outer{
  background-color: red;
  padding: 5px;
}
#inner{
  background-color: blue;
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜