Solved

css float right

Posted on 2014-04-19
2
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Progress

705 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