Skip to content

Overriding bottom-margin of h1 #2890

Answered by squidfunk
Fatih20 asked this question in Q&A
Discussion options

You must be logged in to vote

All typography is defined in _typeset.scss. For example, here are the styles for a h1:

// Headline on level 1
h1 {
margin: 0 0 px2em(40px, 32px);
color: var(--md-default-fg-color--light);
font-weight: 300;
font-size: px2em(32px);
line-height: 1.3;
letter-spacing: -0.01em;
}

Note that we use custom functions in SCSS (which transpiles to CSS) like px2em which are not available in CSS. You can use .md-typeset h1 to style the selector, or something similar (matching the specificity of the original definition):

.md-typeset h1 {
  margin-bottom: 0;
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Fatih20
Comment options

@squidfunk
Comment options

Answer selected by Fatih20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants