Height vs width

Actually i had this one little doubt which was in “OVERFLOW” context only thats why i wanted to clear there only.
PLease dont be strict so much.

In case of height the body can go as long as its content is going down (thats why we get a scroll bar vertical when the content of body overflows the initial height of the viewport). ANd also body and html both scrolls down till the content ends . (assuming body has no margins).

But in case of width why does not the html and body does not extend horizontally ? What concept am i missing?

You don’t need a technical answer for this but simple common sense :slight_smile:

If the body automatically extends horizontally to accommodate its content then that would result in all paragraphs being one single line of text only and be about half a mile long. I’m sure the original inventors of the browser didn’t think that would be a good idea. :slight_smile:

Vertical scrolling is a requirement though so rules are obviously constructed to allow this structure to make sense.

Bear in mind that for responsive design you never want a horizontal scrollbar on the viewport anyway because that means you broke something somewhere. All content must be under your control at all times.

As I said before none of these questions are actually productive for you unless you tell me what problem you want to solve?

A post was split to a new topic: Please explain the difference between these two sets of code

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.