开发者

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

开发者 https://www.devze.com 2023-03-12 11:50 出处:网络
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 cor

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

精彩评论

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

关注公众号