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
    Jul 2011
    Location
    Denmark
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    #navbar linking aint working

    When i try to link my menu to the #navbar in the CSS file, it aint working?
    I dont know what ive been doing wrong, can somebody see it?

    Code:
    <div id="navbar">
    		<ul>
    			<li><a href="sejmno.html" class="current" >Hjem</a></li>
    			<li><a href="#">Om D-skin</a>
    				<ul>
    					<li><a href="opbygning.html">Opbygning</a></li>
    					<li><a href="#">Anvendelse</a></li>
    					<li><a href="#">Medarbejdere</a></li>
    			   </ul>
    		  </li>
    			<li><a href="/faq.php">FAQ</a>
                    <ul>
                    <li><a href="#">'FAQ'</a></li>
                    </ul>
              </li>
    			<li><a href="/contact/contact.php">Kontakt</a></li>
    		</ul>
    	</div>



    And my css for it:

    }

    #navbar {
    border:none;
    border:0px;
    margin:0px;
    padding:0px;
    font: 67.5% "256 Bytes Almindelig", "Agency FB", "Times New Roman";
    font-size:20px;
    font-weight:bold;
    }
    #navbar ul{
    background:#333333;
    height:35px;
    list-style:none;
    margin:0;
    padding:0;
    }
    #navbar li{
    float:left;
    padding:0px;
    }
    #navbar li a{
    background:#333333 url("images/seperator.gif") bottom right no-repeat;
    color:#cccccc;
    display:block;
    font-weight:normal;
    line-height:35px;
    margin:0px;
    padding:0px 25px;
    text-align:center;
    text-decoration:none;
    }
    #navbar li a:hover, .menu ul li:hover a{
    background: #2580a2 url("images/hover.gif") bottom center no-repeat;
    color:#000000;
    text-decoration:none;
    }



    #navbar li ul{
    background:#333333;
    display:none;
    height:auto;
    padding:0px;
    margin:0px;
    border:0px;
    position:absolute;
    width:225px;
    z-index:200;
    /*top:1em;
    /*left:0;*/
    }
    #navbar li:hover ul{
    display:block;

    }
    #navbar li li {
    background:url('images/sub_sep.gif') bottom left no-repeat;
    display:block;
    float:none;
    margin:0px;
    padding:0px;
    width:225px;
    }
    #navbar li:hover li a{
    background:none;

    }
    #navbar li ul a{
    display:block;
    height:35px;
    font-size:16px;
    font-style:normal;
    margin:0px;
    padding:0px 10px 0px 15px;
    text-align:left;
    }
    #navbar li ul a:hover, #navbar li ul li:hover a{
    background:#2580a2 url('images/hover_sub.gif') center left no-repeat;
    border:0px;
    color:#ffffff;
    text-decoration:none;
    }
    #navbar p{
    clear:left;
    }

    Hope somebody is able to help at this

  • #2
    New Coder
    Join Date
    May 2011
    Posts
    79
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Did you include the css file using something like this?:
    Code:
    <link type="text/css" rel="stylesheet" href="path/to/stylesheet.css">
    Quote Originally Posted by bullant View Post
    Basically - Java is to Javascript as Ham is to Hampster.

  • #3
    New Coder
    Join Date
    Jul 2011
    Location
    Denmark
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh yes, ofcourse::

    Code:
    <link rel="stylesheet" type="text/css" href="../cssfiler/css.css">

  • #4
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Quote Originally Posted by sejmno View Post
    Oh yes, ofcourse::

    Code:
    <link rel="stylesheet" type="text/css" href="../cssfiler/css.css">
    You have a folder named cssFiler? or should it be cssFile?
    Teed

  • #5
    New Coder
    Join Date
    Jul 2011
    Location
    Denmark
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by teedoff View Post
    You have a folder named cssFiler? or should it be cssFile?
    The Href for the Stylesheet is working, because ive edited alot else, h1,h2,h3, banner etc etc etc.. Its only for the #navbar it aint working.

  • #6
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Could you please post ALL your html.

    You CSS above validates with no errors. I'd like to see if your mark up validates as well.
    Teed

  • #7
    New Coder
    Join Date
    Jul 2011
    Location
    Denmark
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here it is. By the way, dont mind about the <br />'s.


    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="da">
    
    
    <head>
    <link rel="stylesheet" type="text/css" href="../cssfiler/css.css">
    <title>D-Skin DK ApS</title>
    
    </head>
    
    
    <body>
    <h5 class="bund">D-Skin Denmark ApS</h5>
    <div id="wrapper">
    <img id="banner" src="../billeder/banner.jpg">
    
    	<div id="navbar">
    		<ul>
    			<li><a href="sejmno.html" class="current" >Hjem</a></li>
    			<li><a href="#">Om D-skin</a>
    				<ul>
    					<li><a href="opbygning.html">Opbygning</a></li>
    					<li><a href="#">Anvendelse</a></li>
    					<li><a href="#">Medarbejdere</a></li>
    			   </ul>
    		  </li>
    			<li><a href="/faq.php">FAQ</a>
                    <ul>
                    <li><a href="#">'FAQ'</a></li>
                    </ul>
              </li>
    			<li><a href="/contact/contact.php">Kontakt</a></li>
    		</ul>
    	</div>
    
    
    <h1>Velkommen til D-Skin Danmarks Officielle Hjemmeside</h1>
    
    
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    	<img id="billedmargin" src="../billeder/sidebilled.png" style="opacity:0.1;filter:alpha(opacity=10)">
    
    
    
    
    </body>
    
    
    </html>

  • #8
    New Coder
    Join Date
    Jul 2011
    Location
    Denmark
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Arent you able to help me? I've tried ANYthing, cant find the issue.. :3

  • #9
    New Coder
    Join Date
    Jul 2011
    Location
    Denmark
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ive never tried anything like this.. This worked, when i changed out ID to CLASS???
    Code:
    <div class="menu">
    		<ul>
    			<li><a href="#" >Hjem</a></li>
    			<li><a href="#" id="current">Om D-skin</a>
    				<ul>
    					<li><a href="opbygning.html">Opbygning</a></li>
    					<li><a href="#">Anvendelse</a></li>
    					<li><a href="#">Medarbejdere</a></li>
    			   </ul>
    		  </li>
    			<li><a href="/faq.php">FAQ</a>
                    <ul>
                    <li><a href="#">'FAQ'</a></li>
                    </ul>
              </li>
    			<li><a href="/contact/contact.php">Kontakt</a></li>
    		</ul>
    	</div>



    And then:

    Code:
    .menu {
    	border:none;
    	border:0px;
    	margin:0px;
    	padding:0px;
    	font: 67.5% "256 Bytes Almindelig", "Agency FB", "Times New Roman";
    	font-size:20px;
    	font-weight:bold;
    	}
    .menu ul{
    	background:#333333;
    	height:35px;
    	list-style:none;
    	margin:0;
    	padding:0;
    	}
    	.menu li{
    		float:left;
    		padding:0px;
    		}
    	.menu li a{
    		background:#333333 url("images/seperator.gif") bottom right no-repeat;
    		color:#cccccc;
    		display:block;
    		font-weight:normal;
    		line-height:35px;
    		margin:0px;
    		padding:0px 25px;
    		text-align:center;
    		text-decoration:none;
    		}
    		.menu li a:hover, .menu ul li:hover a{
    			background: #2580a2 url("images/hover.gif") bottom center no-repeat;
    			color:#000000;
    			text-decoration:none;
    			}
    
    	
    		
    	.menu li ul{
    		background:#333333;
    		display:none;
    		height:auto;
    		padding:0px;
    		margin:0px;
    		border:0px;
    		position:absolute;
    		width:225px;
    		z-index:200;
    		/*top:1em;
    		/*left:0;*/
    		}
    	.menu li:hover ul{
    		display:block;
    		
    		}
    	.menu li li {
    		background:url('images/sub_sep.gif') bottom left no-repeat;
    		display:block;
    		float:none;
    		margin:0px;
    		padding:0px;
    		width:225px;
    		}
    	.menu li:hover li a{
    		background:none;
    		
    		}
    	.menu li ul a{
    		display:block;
    		height:35px;
    		font-size:16px;
    		font-style:normal;
    		margin:0px;
    		padding:0px 10px 0px 15px;
    		text-align:left;
    		}
    		.menu li ul a:hover, .menu li ul li:hover a{
    			background:#2580a2 url('images/hover_sub.gif') center left no-repeat;
    			border:0px;
    			color:#ffffff;
    			text-decoration:none;
    			}
    	.menu p{
    		clear:left;
    		}

    But thanks for help anyway.


  •  

    Posting Permissions

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