Solved

css float right

Posted on 2014-04-19
2
210 Views
Last Modified: 2014-04-19
I don't know why the content of my navigation bar is listed backward when I did "float:right" (see code below)

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="index2style.css" />


</head>

<body>
<div id="container">
	<!--------------- HEADER -------------------------------->
	<div id="header">
    	<div id="logo">logo</div>
      <div id="search">search</div>
        <div id="nav">
        	<ul>
              <li><a href="#">Home</a></li>
              <li><a href="#">About Us</a></li>
              <li><a href="#">Services</a></li>
              <li><a href="#">Contact Us</a></li>
              <li><a href="#">Customer Portal</a></li>

            </ul>
            
        </div>    
    </div>
    <!-------- END OF HEADER -------------------------------->
    <!----////////////////////////////////////////////////--->
    <!--------------- BANNER -------------------------------->
<div id="banner">
	  <div id="bannerPic">banner</div>
        <div id="bar">greybar</div>
	</div>
    <!-------- END OF BANNER -------------------------------->

Open in new window



@charset "utf-8";
/* CSS Document */

html,body,div,h1,h2,h3,p,ul,il {
	background-color: #FFF;
	margin:0;
	padding:0;
}

body {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #333;
	background-color: #FFF;
	margin: 0px auto 0px auto;
	padding: 0px;
	width:960px;
}
a {
	text-decoration:none;
}
a img {
	border:0;
}

#logo {
	float:left;
	width: 280px;
	height: 100px;

}
#search {
	height:65px;

}
#nav {
	width:680px;

}
#nav li {
	list-style-type:none;
	float: right;	
}
#banner {
	clear:both;
}

Open in new window

0
Comment
Question by:leblanc
2 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 40010403
Try this instead
http://jsbin.com/gutag/1/
#nav ul{float:right;}
#nav li {
	list-style-type:none;
    float:left;
	
}

Open in new window

0
 
LVL 1

Author Comment

by:leblanc
ID: 40010417
i forgot that ul and li are two different things. Thank you.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question