I want to set width and height to my div in css, but it will only work if I have position:absolute and I dont want to have that. Cause when I have position:absolute it wont work out so good on other screens. And I want so it stays that width even if I dont have any text or something! 🙂
look:
.menu {
width:450px;
height:300px;
background:rgba(0,0,0,0.5);
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-khtml-border-radius: 7px;
}
but I dont get anything from that…
Thanks! 🙂
You don’t need to declare
position:absolutein order to havewidthandheightworking. The only restriction is, it has to be ablock-levelelement, whichdivis by default. So it should work without problems.Maybe you have
display:inlinedeclared on it? If you have so, change it todisplay:inline-block;or omit the display entirely, depending on your markup.