Jump to content

Black bgr color at top of page?


eduard
 Share

Recommended Posts

How do I also get black background color at the top of the page? <!DOCTYPE html> <html><head> <meta http-equiv="content-type" content="text/ html; charset=UTF-8"> <title>Eduard Lid</title> <link rel="stylesheet" type="text/css" href="ex1.css"> </head><body> <div id="container"> <div id="main"> </div><!-- end #main --> <p id="name">web<br>design diseñar<span id="copyright">Copyright © 2013</span></p> <a href="http://ar.linkedin.com/in/eduardlid"> <<img id="rot" src="http://www.linkedin.com/img/webpromo/btn_viewmy_120x33_es_ES.png?locale=" width="120" height="33" border="0" alt="Ver el perfil de Eduard Lid en LinkedIn" /* Rotate div */ </a> </div><!-- end #container --> </body></html> * { margin:0; padding:0; list-style-type:none; }body{ font: bold 15px arial,geneva,SunSans-Regular,sans-serif; background-color:#000000; }#container { min-width:966px;height:100%; } #main { clear:both; position:relative; height:380px; background-color:#fffff0; border:4px solid #808080; } #name { position:relative; font-size:50px; color:#7fff00; text-align:center; }#copyright { position:absolute; top:40px; right:100px; font-size:10px; color:#fff; } #rot {transform:rotate(-30deg);-ms-transform:rotate(-30deg); /* IE 9 */-moz-transform:rotate(-30deg); /* Firefox */-webkit-transform:rotate(-30deg); /* Safari and Chrome */-o-transform:rotate(-30deg); /* Opera */}

Link to comment
Share on other sites

1. Since your body background is black, add a margin-top to the first div on the page. 2. Add a black background to the first div on the page. 3. Add a wide black border-top to the first div on the page. 4. Insert a black div at the top of the page. One of those should work. 1 and 3 will not allow you to have content in the black area; 2 and 4 will.

Link to comment
Share on other sites

1. Since your body background is black, add a margin-top to the first div on the page. 2. Add a black background to the first div on the page. 3. Add a wide black border-top to the first div on the page. 4. Insert a black div at the top of the page. One of those should work. 1 and 3 will not allow you to have content in the black area; 2 and 4 will.
Many thanks!A beginner's question: What's exactly the difference between a container and a div?
Link to comment
Share on other sites

Almost any element can be thought of as a container. I usually think an element is a contained if it displays as a block and is normally used to hold other things. I think of a div as a container. The new header and footer elements work like divs, so they are also containers in my mind. I do not usually think of a link or a list item as a container. Container is not an official word used by the W3C, so other people may have different meanings for it.

Link to comment
Share on other sites

Almost any element can be thought of as a container. I usually think an element is a contained if it displays as a block and is normally used to hold other things. I think of a div as a container. The new header and footer elements work like divs, so they are also containers in my mind. I do not usually think of a link or a list item as a container. Container is not an official word used by the W3C, so other people may have different meanings for it.
All the css of an element makes it a container?
Link to comment
Share on other sites

To my mind, just being a block-level element makes something a container. So if you wanted to use CSS to make a span display as a block element, I guess that would make it a container also. Is there a particular problem you are trying to solve? Or did you read something in a book you want to understand more carefully? I ask because I know you want to improve your skills, and this concept seems so unimportant, you might spend your time on something better.

Link to comment
Share on other sites

To my mind, just being a block-level element makes something a container. So if you wanted to use CSS to make a span display as a block element, I guess that would make it a container also. Is there a particular problem you are trying to solve? Or did you read something in a book you want to understand more carefully? I ask because I know you want to improve your skills, and this concept seems so unimportant, you might spend your time on something better.
Ok, thanks!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...