- 1

What am I doing wrong

I'm just started creating a website and am having trouble with the nav bar. I added a background color to it but then when I try to float the unordered list right, the background color disappears. Am I doing something wrong. this is the css .nav {font-family: sans-serif; background-color: #522714 ; color: white;} .nav ul {width: 50%; float: right;}

27th Jul 2017, 3:52 AM
Samkelisiwe Dladla
Samkelisiwe Dladla - avatar
2 Respostas
+ 14
can't say (coz complete code is not shown) try putting background-color in the ul or li of the nav like this: nav ul li { padding:10px; float:left;background-color: gray;} it should work just fine!😊👍
27th Jul 2017, 6:15 AM
CC Calvello
CC Calvello - avatar
0
Thank you. Will try that.
28th Jul 2017, 1:28 AM
Samkelisiwe Dladla
Samkelisiwe Dladla - avatar