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 5 of 5
  1. #1
    New Coder
    Join Date
    Dec 2008
    Posts
    24
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Setting a border + Background Color

    Ok, I'm gonna address 2 issues in this thread:

    1.
    I have a border surrounding my content (Seperating it from the background of the site), in every place except for the left. The left is just open, no borders, no nothing.

    2.
    I'm trying to set a background color OUTSIDE of the "Wrapper" (you know, like in pretty much every site in the world, theres the content, and the open space around it...THAT'S the part I wanna change).

    I have no Idea on how to set the background there (i've tried setting <body bgcolor="blue"> but that made ALL my content blue (maybe it's because I don't have a border? xD).

    Here is my HTML code and CSS code:

    CSS:

    Code:
    @charset "utf-8";
    /* CSS Document */
    
    #body {
    	
    	background:#39F;
    	font-size: 14px;
    	font-family: Verdana, Helvetica, Sans-Serif;
    	margin: 0px auto 0px;
    	padding: 0px;
    	}
    
    #header {
    	
    	background: #333333 url(bannar.jpg);
    	width: 962px;
    	height: 180px;
    	margin: 0px auto 0px;
    	padding: 0px 0px 0px 0px;
    	text-align: center;
        text-transform: uppercase;
    
    
    }
    
    
    #wrapper {
    	width: 961px;
    	margin: 0px auto 0px;
    	padding: 0px;
    	}
    
    
    #sidebar {
    	background:#d6d6d6;
    	float:left;
    	width:180px;
    	border-style:solid;
    	border-width:1px;
    	padding:5px;
    	}
    	
    #content_center {
    	float:right;
    	width:740px;
    	border-style:solid;
    	border-width:1px;
    	padding:5px;
    	}
    	
    	
    #content_center {
    	float:right;
    	width:740px;
    	border-style:solid;
    	border-width:1px;
    	padding:5px;
    	}	
    	
    	
    #content{
    padding-top:5px;
    padding-bottom:15px;
    }
    
    #newsbar{
    background:#d6d6d6;
    padding:10px;
    height:10px;
    border-top-style:solid;
    border-top-width:1px;
    border-left-style:solid;
    border-left-width:1px;
    border-right-style:solid;
    border-right-width:1px;
    }
    
    #news {
    padding-right:10px;
    padding-top:5px;
    padding-bottom:5px;
    padding-left:15px;
    border-left-style:solid;
    border-left-width:1px;
    border-right-style:solid;
    border-right-width:1px;
    font-size:14px;
    
    }
    
    #newsbottom{
    padding-right:10px;
    padding-top:5px;
    padding-bottom:5px;
    padding-left:15px;
    border-bottom-style:solid;
    border-bottom-width:1px;
    border-left-style:solid;
    border-left-width:1px;
    border-right-style:solid;
    border-right-width:1px;
    }
    .news_header{
    float:left;
    width:300px;
    }
    .news_date{
    float:right;
    text-align:right;
    width:300px;
    }
    
    #footer
    
    {
    	
    margin-left:auto;
    margin-right:auto;
    clear:both;
    margin-top: 15px;
    background: #333333 url(images/topbar.gif);
    width: 961px;
    color: #FFFFFF;
    padding: 10px 0px 10px 0px;
    text-align: center;
    }
    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>Untitled Document</title>
    <link href="Start.css" rel="stylesheet" type="text/css"  />
    </head>
    
    <body>
    
    <div id="wrapper">
    
    <div id="header"> </div>
    
    	<div id="sidebar">
        
        <ul>
        <li> Home </li>
        <li> About us </li>
        </ul>
        
        </div>
      
        
        <div id="content_wrapper">
    
    			<div id="content_center">
                
                
                 <div id="newsbar"><div class="news_header"><strong>News Title:</strong> Display Page</div><div class="news_date"><strong>Posted On:</strong> 28/02/2009</div><div style="clear:both;"></div></div>
      <div id="news">I have implemented a new system when going through the rom archive. You will now notice at the bottom of each rom page there is a numbered page system. This was done after a few complaints that it was too hard to look through the archive.<br>So i hope this makes things a little easier.<br><br>
    Thanks<br>
    Admin</div>
    
      <div style="clear:both;"></div>
      <div id="newsbottom"><div class="news_header"><strong>Posted By:</strong> Admin</div><div class="news_date"><strong>Comments:</strong> 0 (<a class="contentlink" href="index.php?page=news_comments&nid=77">Post A Comment</a>)</div><div style="clear:both;"></div>
        <br />
      </div>
    </div>
    </div>
    <div id="footer">
    </div>
    </div>
    
    </body>
    </html>

  • #2
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    Code:
    body { background: #000; }
    That is what you are talking about?

    Live preview of site? Validate
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,688
    Thanks
    22
    Thanked 1,829 Times in 1,813 Posts
    You don't have an element with the id of #body.
    Your CSS should look more like this -
    Code:
    body {
    	
    	background:#39F;
    	font-size: 14px;
    	font-family: Verdana, Helvetica, Sans-Serif;
    	margin: 0px auto 0px;
    	padding: 0px;
    	}
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #4
    New Coder
    Join Date
    Dec 2008
    Posts
    24
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Yea but when I do THAT, my whole site becomes blue (yea I checked in "Live View").

    I think it's because I haven't clearly set the borders yet.

    I noticed that it looks the way I want it to when I use the last code posted in HERE:

    http://www.codingforums.com/showthre...558#post802558

    But I have no idea what the original problem was...

  • #5
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    live preview?

    I would start from scratch. learn newer and cleaner technique.
    http://bonrouge.com/3c-hf-fluid-lc.php
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!


  •  

    Posting Permissions

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