Results 1 to 2 of 2

Thread: I need help with css and html

  1. #1
    Eljol is offline New Member: Posts Will Be Moderated
    Join Date
    Apr 2011
    Posts
    1

    I need help with css and html

    Hey I just begun learning css and html and am having a problem with my webpage.

    I noticed that when I previewed the page I had created in notepad++, it only filled a small part of the left side of the screen. What i want to know is how do I get my webpage to cover up the whole page like almost every site on the internet does? All i see is white on the other side of the screen, please help
    Here is my css code :
    #container {
    width:900px
    }
    #header{
    width:900px;
    height:100px;
    border-bottom:2px solid #999;
    background-color:#036;
    }
    #leftnav {
    float:left;
    width:140px;
    height:300px;
    background-color:#03C;
    border-right: 1px dashed #03F;
    }
    #rightnav {
    float:right;
    width:140px;
    height:300px;
    background-color:#0CF;
    border-left:1px #0F6;
    }

    #midsection{
    width:600px;
    background-color:#30C;
    }
    #footer {
    clear:both;
    background-color:#F00;
    }

    and here is my html code :
    <html>
    <head>
    <link rel="stylesheet" href="stylesheet.css" type="text/css" />
    </head>
    <body>

    <div id="container">

    <div id="header"></div>

    <div id="leftnav">
    <ul>
    <li><a href="http://www.w3schools.com/">Homepage</a></li>
    <li><a href="http://www.w3schools.com/">About Us</a></li>
    <li><a href="http://www.w3schools.com/">New Releases</a></li>
    <li><a href="http://www.w3schools.com/">Upcoming events</a></li>
    </ul>

    </div>
    <div id="rightnav">
    <li><a href="http://www.w3schools.com/">Visit W3Schools</a></li>
    <li><a href="http://www.w3schools.com/">Visit W3Schools</a></li>
    <li><a href="http://www.w3schools.com/">Visit W3Schools</a></li>
    <li><a href="http://www.w3schools.com/">Visit W3Schools</a></li>
    </div>
    <div id="body">
    </div>

    </div>
    <div id="footer"></div>
    </div>

    </body>

    </html>

    Ps: notice that the colors and links are just examples that will be changed, and I apoligize if I have specefied to much information, first time posting here so I hope you guys don't mind

  2. #2
    Join Date
    Apr 2011
    Location
    sault ste marie
    Posts
    32
    if you want the content centered add
    margin-left:auto;
    margin-right:auto;

    to your container ID that will allow the site to resize around your central content so that the whitespace will be on either side in equal proportions

    hope thats what you were asking if not let me know and I will try and help

Similar Threads

  1. help html css
    By channark in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 29 Jan 2011, 05:09 PM
  2. HTML versus XHTML, Inline CSS versus External CSS
    By junkeeper in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 23 Jan 2010, 10:20 AM
  3. CSS or HTML? And How?
    By Soup in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 08 May 2006, 01:20 PM

Posting Permissions

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