divinedesigns1 Posted April 28, 2015 Share Posted April 28, 2015 ok, im trying to make a responsive menu but my background for the div keep on disappearing after i place the code in the li tag display:block;float:left; can anyone tell me what im doing wrong here? code is as follow html, body { min-width:100%; height:100%; padding:0px; margin:0px;}.menu { width:80%; height:auto; background-color:rgba(0,153,204,0.5); margin:0px auto; text-align:center; font-family:Verdana, Geneva, sans-serif; font-size:100%;}.menu > ul { margin:0px; padding:0px; list-style:none;}.menu > ul li { width:10%; height:50px; background:#666; display:block; float:left;} Link to comment Share on other sites More sharing options...
Ingolme Posted April 28, 2015 Share Posted April 28, 2015 Floated elements aren't taken into account when calculating the height of their parent element. To fix this, set the overflow property of the parent (in this case, the .menu element will work) to "hidden" or "auto" Link to comment Share on other sites More sharing options...
divinedesigns1 Posted April 28, 2015 Author Share Posted April 28, 2015 Floated elements aren't taken into account when calculating the height of their parent element. To fix this, set the overflow property of the parent (in this case, the .menu element will work) to "hidden" or "auto" ok, thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now