IE min-width

Never-mind… I’m getting there… added body to css and get a scroll bar…

How on earth can I set a min-width on the html body?

Iv’e tried along the lines of…

<body>
<div class="gridContainer clearfix minwidth">

body, * html .minwidth {
min-width:320px !important;
}

but IE ignores this

The star HTML hack (* html{}) is purely for IE6.

What IE are you talking about? From that code, I gather you are working with very old IE?

FYI for those IE browsers that don’t support min-width, they treat “width” as min-width. But first let’s see what IE you are talking about.

Well I was adding min-width to stop the form elements collapsing. I think one of the smaller phone widths is around 320px,

The above body seems to have done the job, but in IE browser a scroll bar will appear when shrank to a certain point. I thought the min-width wouldn’t allow the browser to shrink beyond that point

using v 11.09

No. Min-width means the element must be that wide. Users can certainly go smaller than that if they want, which leads to scrollbars. You generally don’t want min-widths when getting to those mobile-small viewports.

Let’s say you’re on mobile which goes 320px wide. You set <body> to min-width:350px (example)…they will get scrollbars still.

Max-width of like 320px will restrict it to a maximum width. But this seems to be heading into “band-aid fix” territory right now.

So theres no html/css way of setting a minimum width? By min width, I mean a width that will not go lower than said

Users have ultimate control over the browser. Elements can be restricted. Users cannot.

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