How do you include margins in your website body?

How do you put margins (space) on both the left and right side of your website?

Posted over 4 years ago by Joseph
Posted over 4 years ago by Joseph

Thanks Alex! I fixed it by adding <div class="container-fluid> in the application.html.erb (from your Yelp course) which contains the margins css.

1
Posted over 4 years ago by Alex Yang

Ah great - Bootstrap's 'container' and 'container-fluid' classes will add some default margins for you. If you need to customize these, you'll always be able to do that through your stylesheets.

1
Posted over 4 years ago by Alex Yang

There are a couple ways. You can either use the 'margin-left' and 'margin-right' selectors or you can just use the 'margin' selector, making sure to set the top/bottom value to zero. For example, you could write the following in your stylesheet: "margin: 0px 10px". Hope that helps!

1
Posted over 4 years ago by Joseph

Right now, the site I am building has contents that verges on the margin of the site. How can I have more space in both the left and right side of the site?? Thank you in advance!

1