Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2012
    Location
    Edinburgh
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Having a problem with coloring in the hole DIV

    Hello,

    I'm having trouble with coloring in a DIV. I was googling and I didn't find any solutions that would help me. I have to DIV. 1 DIV is a div to keep the hope web-site centered and the second one is the one which should be at the top and it should be colored in (completely)
    This is my code:

    HTML:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>JFM</title>
    <link rel="icon"  type="image/ico" href="favicon.ico" />
    <link href="css/styles.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    
    <div class="whole_site_container">
    
    	<div class="top_blue">
    	</div>
    	
    </div>
    </body>
    </html>
    CSS:

    Code:
    @charset "utf-8";
    /* CSS Document */
    
    #whole_site_container {
    	width: 1000px;
    	margin-right: auto;
    	margin-left: auto;	
    }
    
    #top_blue {
    	width: 1280px;
    	height: 100px;
    	background-color: #01A4A4;
    }
    Thank you

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    For targeting classes you use a ".":

    Code:
    .whole_site_container {
    	width: 1000px;
    	margin-right: auto;
    	margin-left: auto;	
    }
    
    .top_blue {
    	width: 1280px;
    	height: 100px;
    	background-color: #01A4A4;
    }
    A hash ("#") is used for id's:

    Code:
    <div id="this_is_an_id">
    
    </div>
    http://www.htmldog.com/guides/cssintermediate/classid/
    Last edited by Sammy12; 10-03-2012 at 09:03 AM.

  • Users who have thanked Sammy12 for this post:

    tarasmuz (10-03-2012)

  • #3
    New Coder
    Join Date
    Oct 2012
    Location
    Edinburgh
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thank you so much


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •