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 9 of 9
  1. #1
    New Coder
    Join Date
    Apr 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    LeftNaviation won't left align

    Hi there, Can't seem to get my Links on the left navigation to left align, or get them closer to the side of the page, I've tried padding but it doesnt let me go left only right.

    Heres the code.

    <div id="LeftNavigation">
    <ul>
    <li><a href="UnitCalculator.html" class="active" >Unit Calculator</a></li>
    <li><a href="Comic.html" class="active" >Comic</a></li>
    <li><a href="MotionGraphics.html" class="active" >Motion Graphics</a></li>
    <li><a href="Game.html" class="active" >Driving Game</a></li>
    </ul>
    </div><!-- end of LeftNavigation-->


    ---------------------------------------------------------------------------
    #LeftNavigation a {
    line-height: 14px;
    font-weight:bold;
    margin: 0px 0px 20px 0px;
    padding: 0px 40px 0px 0px;
    text-decoration: none;
    color: #ffffff;
    border-bottom: 1px solid orange;

    }

    #LeftNavigation a.active{

    padding-bottom: 2px;
    color: grey;
    }

    #LeftNavigation a:hover {

    border-bottom: 2px solid orange;
    padding-bottom: 2px;
    colorrange;
    }
    -----------------------------------------------------------------------------

    Any help would be much apreciated, thanks.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello GBizzle99,
    Add this bit highlighted in red to zero out default margin/padding -
    Code:
    * {
    margin: 0;
    padding: 0;
    }
    #LeftNavigation a {
    	line-height: 14px;
    	font-weight:bold;
    	margin: 0px 0px 20px 0px;
    	padding: 0px 40px 0px 0px;
    	text-decoration: none;
    	color: #ffffff;
    	border-bottom: 1px solid orange;
    }
    #LeftNavigation a.active { 
    	padding-bottom: 2px;
    	color: grey;
    }
    #LeftNavigation a:hover {
    	border-bottom: 2px solid orange;
    	padding-bottom: 2px;
    }
    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

  • #3
    New Coder
    Join Date
    Apr 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Add this bit highlighted in red to zero out default margin/padding, sorry Excavator I didnt understand what you were saying in that last post?

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    In the code I quoted, I highlighted in red the bit that you should add to your CSS.
    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

  • #5
    New Coder
    Join Date
    Apr 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have added that in, but doesnt work?

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    Post your complete code (html+CSS), including DOCTYPE. Or a link to your page would be much better.

    PS: Please use [CODE][/CODE] tags to wrap your code while posting here.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #7
    New Coder
    Join Date
    Apr 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Anti-Drink Driving</title>
    <LINK REL=StyleSheet HREF="limitsStyle2.css" TYPE="text/css" MEDIA=screen>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <meta name="generator" content="HAPedit 3.1">
    
    </head>
    <body>
    
    <div id="container">
    
    
    Code:
    <style type="text/css">
    html,body{
    	margin:0;
    	padding:0;
    	background-color:#000;
    }
    
    body{
    	color:#FFF;
    	font: 76% arial,sans-serif;
    	text-align:center;
    	background: #565656 url(Background2.jpg) center fixed;
    	background-repeat: no-repeat;
    }
    p{
    	margin:0 10px 10px
    }
    a{
    	display:block;
    	color: #981793;
    	padding:10px
    }
    
    div#header h1{
    	height:80px;
    	line-height:80px;
    	margin:0;
        padding-left:10px;
        background: #EEE;
        color: #79B30B
     }
     
     div#header {
    
    	background-repeat:no-repeat;
    	width:900px;
    	height:auto;
    }
    
    div#container{
    	width:900px;
    	margin:0 auto;
    	text-align:left
    	
    }
    
    div#content p{
    	line-height:1.4
    }
    
    div#footer p{
    	margin:0;
    	padding:5px 10px
    }
    
    
    
    div#left{
    	background: #666666;
    	float:left;
    	width:150px;
    	height:600px;
    	filter:alpha(opacity=60);
        opacity:0.6;
    	
    }
    
    div#right{
    	background:#FF8539;
    	float:right;
    	width:750px
    	
    }
    
    div#footer{
    	background: #333;
    	color: #FFF;
    	clear:both;
    	width:100%
    }
    
    #NavigationLinks  {
    	margin: 0;
    	padding: 0;
    	
    	
    }
    
    #NavigationLinks li {
    	display: inline;
    	list-style: none;
    }
    
    #NavigationLinks a {
    	float: left;
    	line-height: 14px;
    	font-weight:bold;
    	margin: 0 50px 4px 10px;
    	text-decoration: none;
    	color: #ffffff;
    	border-bottom: 1px solid orange;
    	
    }
    
    #NavigationLinks a.active{ 
    	
    	padding-bottom: 2px;
    	color: grey;
    }
    
    #NavigationLinks a:hover {
    	
    	border-bottom: 2px solid orange;
    	padding-bottom: 2px;
    	color:orange;
    }
    
    #NavigationBar {
    	background: url(NavBar.jpg);
    	background-repeat:no-repeat;
    	width: 900;
    	height:35px;
    }
    
    #LeftNavigation {
    	list-style: none;
    	margin: 0;
    	padding: 0;
    }
    
    #LeftNavigation li {
    	
    	list-style: none;
    }
    
    
    
    #LeftNavigation a {
    	line-height: 14px;
    	font-weight:bold;
    	margin: 0px 0px 20px 0px;
    	padding: 0px 40px 0px 0px;
    	text-decoration: none;
    	color: #ffffff;
    	border-bottom: 1px solid orange;
    	
    }
    
    #LeftNavigation a.active{ 
    	
    	padding-bottom: 2px;
    	color: grey;
    }
    
    #LeftNavigation a:hover {
    	
    	border-bottom: 2px solid orange;
    	padding-bottom: 2px;
    	color:orange;
    }
    
    #FooterLinks  {
    	margin: 0;
    	padding: 0 0 20px 150px;
    	
    	
    }
    
    #FooterLinks li {
    	margin: 0;
    	padding: 0;
    	display: inline;
    	list-style: none;
    }
    
    #FooterLinks a {
    	float: left;
    	line-height: 14px;
    	font-weight:bold;
    	margin: 0 50px 4px 10px;
    	text-decoration: none;
    	color: white;
    	border-bottom: 2px dotted white;
    }
    
    #FooterLinks a.active{ 
    	
    	padding-bottom: 2px;
    	color: white;
    }
    
    #FooterLinks a:hover {
    	
    	border-bottom: 2px solid white;
    	padding-bottom: 2px;
    	color:white;
    }
    
    #FooterBar {
    	background-color:#333333;
    	height:34px;
    }
    
    
    </style>
    <div id="header"> <img id="Logo" border="0" src="logo.gif" width="345" height="75" /> <!--<img id="NavBar" border="0" src="NavBar.jpg" width="100%" height="35px" />--> <div id="NavigationBar"> <ul id="NavigationLinks"> <li><a href="test1.HTML" class="active" >HOME</a></li> <li><a href="Facts.HTML" class="active" >KNOW YOUR FACTS</a></li> <li><a href="Activities.html" class="active" >ACTIVITIES</a></li> <li><a href="Contact.HTML" class="active" >FORUM</a></li> <li><a href="UsefulLinks.html" class="active" >USEFUL LINKS</a></li> </ul> </div><!-- end of NavigationLinks--> </div><!--end of header--> <div id="content"> </div><!--end of content--> <div id="left"> <div id="LeftNavigation"> <ul> <li><a href="UnitCalculator.html" class="active" >Unit Calculator</a></li> <li><a href="Comic.html" class="active" >Comic</a></li> <li><a href="MotionGraphics.html" class="active" >Motion Graphics</a></li> <li><a href="Game.html" class="active" >Driving Game</a></li> </ul> </div><!-- end of LeftNavigation--> </div><!--end of left--> <div id="right"> <p> On this page you can choose different activities and learn about drink drink driving. Just select a link from the side of the page.</p> </br> </div><!--end of right--> <div id="footer"> <div id="FooterLinks"> <ul> <li><a href="test1.HTML" class="active" >HOME</a></li> <li><a href="Activity.html" class="active" >ABOUT SLURP</a></li> <li><a href="Contact.HTML" class="active" >FORUM</a></li> <li><a href="UsefulLinks.html" class="active" >PYXIS MEDIA</a></li> </ul> </div><!-- end of FooterLinks --> </div> <!--end of footer--> </div> <!--end of container--> </body> </html>

  • #8
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    You haven't added
    Code:
    *{
    margin:0;
    padding:0;
    }
    into your CSS, as suggested by Excavator. It's to nullify all browser specific default margin and padding values from all elements.

    PS: put your <style> tags inside <head>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #9
    New Coder
    Join Date
    Apr 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks alot for the swift replies, one more question. How do I make an element centre align, for example if I have a flash game or video i want to put in the right column, how do I make it display in the centre of the column?


  •  

    Posting Permissions

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