hey all i m trying to create a webpage in which i have couple li, inside ul. i m applying float:right to li class .navbar but it don’t apply. i can’t leave it to be just li coz other li in the page float on right too. where am i going wrong?
The code you posted is incorrect: padding-right:5px; 10px; 5px; 0???
Also your submenu div misses the bracket: <div class=“submenu”> instead of <div class=“submenu”
Hi,
You also have an error in your “li” selector. You have it as .navbar li in your css, that is saying target a “li” within the li class .navbar
You really would not need the “li” combined with the class in this case. I really don’t see a need for all those li classes anyway. Just target the li.
I would do away with the pipes and the tags and just set up a right border on my “li”. Then you just need one class on the last item to pull the border off from. Keep in mind when you do right floats like that your last item needs to come first. That would put your “Home” link last in the list.
See if this is closer to what you were trying to do
(BG colors added so you can see what is happening)
When you are giving individual measurements for padding (or margin), just put a space between each measurement, then a semi-colon at the end of the list. ie,