|
I'm trying to change the background colour for I'm only interested in changing the background of the text part so I thought I could add this to my css: section.my_custom_class {
h1 {
display: inline;
background: red;
}
}but h1 tags still span the whole line. Am I doing something wrong? |
Answered by
yhatt
Aug 19, 2021
Replies: 1 comment 1 reply
|
CSS cannot nest selectors so you have to style like this: section.my_custom_class h1 {
display: inline;
background: red;
}It would work if the section.my_custom_class h1 {
align-self: flex-start;
background: red;
} |
1 reply
Answer selected by
yhatt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CSS cannot nest selectors so you have to style like this:
It would work if the
sectionelement was a block container, but it may not yet work in some Marp themes because they are usingsectionas a flex container (required for vertical centering) and its children are stretching to fit the container. In this case, try usingalign-self: flex-start;instead ofdisplay: inline;.