width, responsive

Hello, I come to ask a rookie question, I want everything I have on the page to cover 100% of the width but I don't want to put 100% in any element, so that it doesn't ruin the natural responsiveness of the page, what can I do in that case?
5 Replies
Myndi
Myndi2y ago
You can use dynamic viewports. But be wary of using it on everything. Most of HTML elements are responsive by default.
13eck
13eck2y ago
By default, all elements are responsive. Block-level elements will be 100% width and inline elements will be min-content. Well, images are not responsive by default…sadly they default to their actaul width so one of the first things in every CSS file is
img {
max-width: 100%;
}
img {
max-width: 100%;
}
So it won't grow larger than the containing element.
Trazos
TrazosOP2y ago
thanks for the heeeelp !!!!!
Myndi
Myndi2y ago
That's not all then ratstare
13eck
13eck2y ago
By default all non-replaced elements are responsive :p img, svg, video, etc. Things that take time to load and are "replaced" with the appropriate content

Did you find this page helpful?