flip
flip

Reputation: 119

Why is the content on this webpage on a mobile device with smaller equal 320px width not 100% wide?

I have the issue that on mobile devices with a screen size less/equal 320px the content is not shown 100% wide which you can see in this image: enter image description here

I have also uploaded the files here: http://files.ailola.com/tmp/v1/privacy.php

I have been able to figure out the following points:

Removing the linked stylesheet does not solve the issue neither.

I just do not figure out the reason. Do you have an idea? Thanks so much for your help.

Upvotes: 0

Views: 151

Answers (4)

Rafee Shaik
Rafee Shaik

Reputation: 679

We have to give width: 100% to header, footer and #container.

The word-break property specifies how words should break when reaching the end of a line.

p {
    word-break: break-word;
}

@media only screen and (max-width: 767px) {
    header, footer, #container {
    width: 100%;
    padding: 0 25px;
    }
}

Upvotes: 0

Santanu
Santanu

Reputation: 151

Set initial-scale=1 inside the meta viewport tag in line number 6

Upvotes: 0

Rod
Rod

Reputation: 419

I fixed this with the following:

@media only screen and (max-width: 320px)
#container {
    max-width: inherit;
    width: 100%;
    padding: 0 1em;
    word-break: break-word;
}

screenshot

The problem is because, inside the content, you have links, those are like an entire word, so the container tend to adapt to the longest word (this issue is present in some languages that have long words or expressions). In those cases, you have to use the property word-break. You can find more info here

EDIT:
Apparently, the value break-word of the property word-break is deprecated. Also you can use the property overflow-wrap with the value break-word, as it is has a similar effect.

Upvotes: 1

Dipen Shah
Dipen Shah

Reputation: 26075

There are multiple paragraphs on your page which are overflowing container due to default word wrapping strategy.

enter image description here

To fix the issue apply either word-break or overflow-wrap style to your paragraph:

p {
   ...,
   word-break: break-all;
}

or

p {
   ...,
   overflow-wrap: break-word;
}

enter image description here

Upvotes: 1

Related Questions