• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

bootstrap - white margin left & right small devices only

Enthusiast ,
Oct 10, 2017 Oct 10, 2017

Copy link to clipboard

Copied

Is there a quick fix to ensure all containers are spanning entire width of screen edge to edge on small devices?

On phones, there is what appears to be a 5px white margin on left & right sides.

default:

.container {

  padding-right: 15px;

  padding-left: 15px;

  margin-right: auto;

  margin-left: auto;

}

Could it be the rows causing this conflict?

The body has nothing: html, body { margin: 0; padding: 0; }

Thank you.

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 10, 2017 Oct 10, 2017

Copy link to clipboard

Copied

If you want to span the entire screen width, use  .container-fluid.

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 11, 2017 Oct 11, 2017

Copy link to clipboard

Copied

I tried wrapping that around the container div... the small screen still has the white.

On one of the containers, I also tried replacing - still gave the white at the smallest screens.

Is there something else I can do with the regular containers? Still not sure why it works fine on the larger screens.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 11, 2017 Oct 11, 2017

Copy link to clipboard

Copied

Assuming you DO NOT have a specific width set on the 'container' you could try giving it negative margins:

.container {

  padding-right: 15px;

  padding-left: 15px;

  margin-right: -15px;

  margin-left: -15px;

}

Make sure you have the <body> margin set to 0 as well:

body {

margin: 0;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 11, 2017 Oct 11, 2017

Copy link to clipboard

Copied

LATEST

Change each occurrence of container to container-fluid as per Nancy's suggestion.

<div class="container"> to <div class="container-fluid">

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines