So I am currently coding a website I need help to position these divs to the center of the div please help.
https://i.imgur.com/WauNnEZ.png
https://i.imgur.com/WauNnEZ.png
margin: 0 auto;So I am currently coding a website I need help to position these divs to the center of the div please help.
https://i.imgur.com/WauNnEZ.png
Then you did it wrong.This didn't work.
Pretty sure he is using bootstrap, which is supposed to do this stuff for you.i would suggest using a grid system since grid is bae, but what you can do is:
1. Wrap the three divs in one single div and give it a class like "wrapper" or something
2. set its width to 70% in styles.css or inline css (whichever you are using)
3. set margin-left to 15% and margin-right to 15%
4. if the thing is too wide, than you can set the wrapper div's width to 60% and set margin left and right both to 20%
5. Notice in each example 70% + 15% + 15% = 100% of the width Or 60% + 20% + 20% = 100% of the width
Ye i hope this works for you
width: 70%;
margin: 0 auto;
he said margin: 0 auto isnt working for him thats whyPretty sure he is using bootstrap, which is supposed to do this stuff for you.
Also, for the same thing you just posted you could just use
Code:width: 70%; margin: 0 auto;
He's most likely not setting the width of it, which makes it expand by defaulthe said margin: 0 auto isnt working for him thats why
ye thats probably the problemHe's most likely not setting the width of it, which makes it expand by default
