bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Mobile vs Desktop CSS Negative Margin for ".row" Inconsistent

Open mattnish opened this issue 13 years ago • 3 comments

Perhaps I am missing something, but could you please explain why on desktop the columns' content lines up with the container's edges perfectly and on mobile it doesn't?

On desktop, using the .row's -15px margin and the columns 15px padding makes the column line up with the container. Awesome. On mobile, though, the .row no longer has the -15px margin, and so the column automatically is pushed in 15px. This is problematic on designs that need to go the full 100% on both desktop and mobile. Am I missing something?

Thanks!

Desktop: screen shot 2013-07-31 at 7 16 48 pm

Mobile: screen shot 2013-07-31 at 7 17 20 pm

mattnish avatar Aug 01 '13 02:08 mattnish

For now, I'm just applying "margin-left:-15px;margin-right:-15px;" to .row globally for all screen sizes.

mattnish avatar Aug 01 '13 04:08 mattnish

It seems intentional by the way the css was written.

On small devices the .container width is 100%, to prevent content from touching the viewport edges there's no negative margin.

On medium+ devices the .container has a fixed width so content won't touch the edges anyway. In this case there are negative margins to keep the row's width = container's width.

If you want it to touch the edges you can either put content outside the grid, or add the negative margins manually like you're doing.

fabiogiolito avatar Aug 02 '13 17:08 fabiogiolito

What @fabiogiolito said.

mdo avatar Aug 05 '13 21:08 mdo