+ 1
Why does this white recktangle exist, although i declared 25%width + 75%? And i declared 100 height but its still surrounded
Im making my first experiences with html. And my layout wont lock like i want it to do. https://code.sololearn.com/WxDNI1vc6YZN/?ref=app
4 Antworten
+ 2
Remain section width in 75%
You are almost there.
Just add box sizing to border box and set display inline block for nav and section. Without inline block, the width setting is not taking effect.
Add the following css at the top of your css
* {
box-sizing: border-box;
}
nav, section {
display: inline-block;
}
+ 1
//White is appearing because section is only of 75% of 100% make section 100% to cover white field ;
//yoi thought of giving nav 25% and section 75% thinking of covering total 100% but it doesn't work like this every elements width is relative of screen display
header{
padding:5px;
}
section{
width:100%;
}
+ 1
Thanks alot 😊
0
I tryied it with 100% but it still doesnt work, and the nav is still surrounded by the section