V
V
Vova Putsyk2018-05-24 01:05:41
css
Vova Putsyk, 2018-05-24 01:05:41

How to make .container without padding on one side?

I want to do .container-fluid, but so that there are indents on the left side like in .container.
Simple .container:
5b05e44742216324882437.png
I want something like:
5b05e45beac12645664492.png
And so that it really behaves like .container- so that on mobile devices, for example, there is no indent.
Ultimately, I want to do this .
And yes, I know what .containerworks with max-width.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Froggyweb, 2018-05-24
@Froggyweb

.container
margin: 40px 0 40px auto
background-color: red
width: 80%

S
serenia1, 2020-11-26
@serenia1

Don't thank
@this remove media only screen and (min-width: 1360px) {
.container-fluid{
margin-left: calc(50% - 680px);
}
}
680px is the width of your main container divided by 2.
For example, your container is 1360px / 2 = 680
Adjust the rest of the container and block padding yourself. The code performs the main function. When resizing the window horizontally, your block will remain indented on one side at the level of .container
And be sure to put it in media min-width with the width of the main container

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question