1
I’m really confused how the measurement percentages of CSS
(in particular %) and property height
html {
border: solid 5px #000000;
height: 600px;
margin: 10px;
}
body {
border: solid 5px #470eaf;
height: 100%;
box-sizing: border-box;
}
.app {
border: solid 5px #ff0202;
}
<body>
<div class="app">
<div>Cabeçalho</div>
<div>Corpo</div>
<div>Rodapé</div>
</div>
</body>
In that code the tag <body>
goes beyond the HTML
, Why does this happen? Being that, I defined the property HTML
as 600px
, the body
should not go up 600px
and not exceed this value? Since the tag <body>
has your father as <html>
, should not be respected?
Edit1: I checked that this happens with other child components too:
html {
border: solid 5px black;
}
body {
border: solid 5px red; /*pai de .app*/
height: 600px;
}
.app {
border: solid 5px violet; /*Filho de body*/
display:flex;
flex-direction: column;
flex-wrap: wrap;
height: 100%;
}
.app div.cabecalho {
border: solid 5px blue;
}
.app div.corpo {
border: solid 5px blue;
}
.app div.rodape {
border: solid 5px blue;
}
<div class="app">
<div class="cabecalho">Cabeçalho</div>
<div class="corpo">Corpo</div>
<div class="rodape">Rodapé</div>
</div>
We usually use
id
to work with something more specific, unfortunately it is not the case of my question... The question refers to more types of measures, not a solution in general. For one only works on thebody
with the measureheight
he normally respects thehtml
, but the opposite (as mentioned in the question above) does not work and I would like to know why.– user168265
Welcome guy to en.Stackoverflow, man explains this better then, because you can barely understand what you wrote, your answer has no sense whatsoever...
– Caetano Sincero