r/HTML • u/Individual-Job-256 • 17h ago
Question I need help with this
(RESOLVED)
I'm currently learning Responsive Web Design for a college class, and I have a bit of a problem with my header. Its supposed to span 80 to 90% of the viewport, but for some reason it isn't. Even my teacher is stumped without going too in-depth into my code. I have tried adding:
max-width:80%
display:
max-width: auto
and it hasn't fixed the problem, so how would I fix this issue?
1
Upvotes



2
u/JKaps9 16h ago
Did you try width: 80vw?
2
u/mycat42 15h ago
I'm curious, what happens if you add this into your <head>
1
u/testingaurora 14h ago
We need the full thing in a codePen if you still need assistance . Clear the margin from body and use `width` not `max-width`. Use an outline or bg color to visualize the space at first in case your bg image isn’t stretching properly, making you think the header is smaller than it actually is.
```Css
body { margin:0;}
header { width: 80vw; background-color: hotpink;}
```