Greg
Greg

Reputation: 3063

min-width in page body not working

I have set a minimum width of 767px on my website to avoid everything to be shrunk when viewing the website on a smartphone. The issue is that is that it doesn't seem to be taken into consideration (see screenshot below) Any idea why? Many thanks

CSS:

html,
body {
    height: 100%;
    min-width: 767px;
    -webkit-font-smoothing: antialiased;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
    background: url('../images/background-produits.jpg')no-repeat center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    font-family: 'Open Sans';
    font-size: 16px;
    font-weight: 300;
    line-height: 1.38;
    color: rgb(71, 64, 50);
}

Upvotes: 3

Views: 12391

Answers (2)

Nodir
Nodir

Reputation: 19

You also need to give it width: 100% only then min-width kicks in

Upvotes: -1

rdoyle720
rdoyle720

Reputation: 3130

You've got a lot of things positioned absolutely. For that to work correctly you need to have them contained in an item with relative positioning. Yep, even the body tag, apparently.

body {position: relative}

Upvotes: 5

Related Questions