SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile problem with my page's navbar.

    Hello,

    i have problem with my links in the page's navbar , i want to put my links in the middle of navbar, but i always see my links in the top of it.

    i was used all the ways to fix the problem, but i failed.

    this is an simple example, u can see the problem :

    Code HTML4Strict:
    <!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" dir="ltr">
     
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="EN-US" />
    <title>example</title>
     
    <style type="text/css">
     
    body { background: pink; font-family: "Times New Roman", Times, serif; font-size: medium; color: #B5C3CE; font-weight: bold;
    	text-decoration: none; }
     
    #main {	border: 1px double #000000;	background: red; height: 350px;	width: 777px; margin: auto;
    }
    .nav { background: white; height: 50px; width:777px; text-align:center; }
    a {	color: red;	text-decoration: none; }
    a:hover { color: black; text-decoration: underline; }
    </style>
     
    </head>
     
    <body>
    <div id="main">
    <div class="nav"><a>forum</a></div>
    <div>
    </body>
     
    </html>

    can i find help ? i hope that.

    thanks for reading my subject...

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Hello, and welcome to Sitepoint

    You can vertically center text in an element with line-height.
    Code:
    .nav {
    	background: white;
    	height: 50px;
    	width:777px;
    	text-align:center;
    }
    .nav a { line-height: 50px }
    You also need to close your #main div with </div>

    Hope it helps

  3. #3
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, mark!

  4. #4
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    You're most welcome


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
  •