SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2009
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with UL tag in my CSS document

    Hi,

    i am trying to create a navigation bar using the UL element tag, i've created my links fine, but whenever i click on my links, it some how pushes my page downwards. Can somebody tell me why it does this please.

    homepage_V1.css
    Code:
    /* homepage_V1.css is used to help build my homepage*/
    
     body
    {
        margin-top: 2em;
        margin-left: 2em;
        margin-bottom: 1em;
    
        
    }
    
    div.container
    {
        width: 80em;
        border: solid #9400D3 0.1em;
        height: 40em;
        padding-left: 1em;
        padding-top: 1em;
        padding-bottom: 1em;
    }
    
     div.nav ul
    {
        list-style-type: none;
        
    }
    homepage_V1.html

    Code:
     
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en">
    <head>
        <title>Home Page V1</title>
    <link rel="stylesheet" type="text/css" href="homepage_V1.css" />
    </head>
    <body>
        <div class="container">
        <div class="nav">
            <ul>
                <li><a href="#Home" id="Home" name="Home"> Home </a></li>
                <li><a href="#News" id="Contact" name="Contact"> Contact </a></li>
                <li><a href="#News" id="News" name="News"> News </a></li>
                <li><a href="#About" id="About" name="About"> About </a></li>
            </ul>
        </div>
        
        </div>
    </body>
    </html>
    Thanks

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Hi, you are using internal linking. When you click a link it will try and scroll down to the ID that it matches. If you used a different URL you'd probably see it fixed (untested)

    Or..do whatevery ou want. You kmnow the issue now
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work


Bookmarks

Posting Permissions

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