1

I've downloaded the bootsrap theme at this page: - https://startbootstrap.com/template-overviews/scrolling-nav/

I don't know how to change the CSS files in order to reduce the padding (or margin if it is that) of the <section id="about"> element (file index.html).

Can anyone indicate me where to go?

Thanks a lot!

Luca
  • 13
  • 3
  • 1
    you can add your own css class that overrides the part of css which you need it to override, eg: section{padding:0px!important;} and then add the link of this file to the pages where you need this change – TechGirl Sep 18 '17 at 12:20
  • Inspect element through any browser and you can find line number and complete address where your CSS file exist then you can set padding or reduce padding, or you can write inline css with your class id about. – Omar Hayat Sep 18 '17 at 12:30

2 Answers2

1

I'm assuming you know how to work with external css files atleast.

create a file, lets say home.css. then add the following in the file.

section {
    padding : 0px;
}

I'm putting 0px, adjust according to your requirement.

then add the css file next to your bootstrap file inclusion tag in your index.html file

<link href="/path/to/bootstrap">
<link href="/path/to/home.css">

that should work I guess...

Remember to put it below the file you want to overwrite.

Extra Notes: if you want to use !important. Read this article. https://css-tricks.com/when-using-important-is-the-right-choice/

Tomonso Ejang
  • 1,336
  • 3
  • 15
  • 27
1

In addition to Tomonso's explanation of including an external css file, I would recommend putting your own custom class on your section and setting the css on that class. You can do the same thing with your "about" id, but it's likely you're going to have a bunch of sections that you want to format with the same spacing. Both of these will be more specific than bootstrap's styling and will have precedence. If you just override the section styling, then the file order matters. See here for css precedence details.

As for whether you want padding or margin, ask yourself whether you want the spacing inside the border or not. If you have no border, do you want the spacing to be the same color as the section or just transparent. If your section and containing element are the same color, then it probably doesn't matter which one you use. Reference.

Tracy Moody
  • 1,089
  • 6
  • 17