I’m looking at decreasing the space between Heading 1s (H1) and the paragraph before it in the Hugo Docs Theme. The idea is to take back the wasted screen real estate space (see pic).
I thought it must be a top-margin for H1 but tinkering with the H1s in _contents.css and app.css hasn’t helped.
I’ve looked at:
The _content.css file in the /assets folder has an h1 component, but there doesn’t seem to be any top:margin component in the file.
The app.css file in assets/output/css folder seems to have a margin-top: 0; h1 component but the value of that is also 0.
Searching for margin-bottom in the assets/output/css folder gives me 106 matches and tbh I have no idea which of these would control these margins.
If anyone could hint or share what margin-top or margin-bottom should I be looking for and in what CSS file, I would be grateful…!
If you right click the header in your browser and select “Inspect element” the developer tools will open up. There you can see exactly what rules effects what part of the site. You can even change the css to experiment. No need to guess.
Looking at the Hugo documentation site it looks like the header you point out is a H2 header. The css rule is:
Yes. I’m aware of Inspect Element and the css file to look for is _documentation-styles.css in /assets/css/_documentation-styles.css. On directly changing in the developer tools, the changes are reflected but making the changes in the _documentation-styles.css file itself doesn’t show it as reflected.
The said piece of code in _documentation-styles.css being:
I mean, I cleared the browser cache, did a hard refresh crt+F5, tried the site in another browser etc but no luck. So, QQ:I’m wondering if Hugo saves the CSS in a cache folder or something and I need to clear some hugo cache folder(s)? Or is there any specific hugo command I need to run here to clear any js or css cache files?
Here’s how my inspect element looks btw. It’s just like what you have said.