Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add completely flush containers (with no padding) #18207

Closed
James1345 opened this issue Nov 10, 2015 · 14 comments
Closed

Add completely flush containers (with no padding) #18207

James1345 opened this issue Nov 10, 2015 · 14 comments

Comments

@James1345
Copy link

Bootstrap has container and container-fluid classes for content. While container-fluid is full-width, it comes with some padding, which is undesirable in certain scenarios (e.g. sidebars that are not floating).

I recommend a container-flush class (or a different name if you prefer) that mimics fluid, but has 0 padding on all sides.

@James1345
Copy link
Author

For bootstrap 4. I forgot to put that in the issue title and I can't add labels/change the title now

@Skwai
Copy link

Skwai commented Nov 10, 2015

I'd also recommend adding a .row-p-0 or similar that creates a grid with 0 padding

@cvrebert
Copy link
Collaborator

@Skwai If you mean no padding between the columns, there's apparently no interest in that: #15530 (comment)

@cvrebert cvrebert changed the title Completely flush containers Add completely flush containers (with no padding) Nov 10, 2015
@Skwai
Copy link

Skwai commented Nov 10, 2015

That's interesting. On many projects I often use the following:

.row-compact {
  margin-left: 0;
  margin-right: 0;
  > [class^="col"] {
    padding-left: 0;
    padding-right: 0;
  }
}

@JefMari
Copy link

JefMari commented Nov 11, 2015

I'd also recommend it on container for non-grid html usage

@mdo
Copy link
Member

mdo commented Dec 8, 2015

Nuking the padding on the container means nuking the margin on the rows with likely means nuking the padding on the columns. Rather than nuke all those styles, maybe just roll something custom?

@mdo mdo mentioned this issue Dec 8, 2015
17 tasks
@mdo
Copy link
Member

mdo commented Feb 6, 2016

Punting.

@mdo mdo closed this as completed Feb 6, 2016
@hassanasad
Copy link

There should be a way to remove container padding (left right) for mobile device. The grid system works great but in certain scenarios there is no left/right padding required on the main container level.

I am trying to find a neat hack for this but so far no go.

@mdo
Copy link
Member

mdo commented Dec 2, 2016

.p-xs-0 and other margin utilities will do the trick.

@Starsam80
Copy link
Contributor

.p-xs-0 and other margin utilities will do the trick.

I think you mean .p-0, as we removed -xs from all the utilities

@hassanasad
Copy link

sorry - my fault, i am actually on bootstrap 3. This discussion is probably related to v4. (sorry)

@mdo
Copy link
Member

mdo commented Dec 2, 2016

Hah, assumptions abound on my part. I figured this was v4 so I was pointing out what's documented there today and not what's in v4-dev. If you do update to v4, as @Starsam80 mentions, the syntax has changed :).

@jawadafghanistany
Copy link

hi
i have a question from bootstrap developers.
why container-fluid have 30px padding:
.container-fluid { width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; }
please explain it to me.

@businessai
Copy link

businessai commented Apr 29, 2022

.pl-0 .pr-0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants