Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

CSS for H2 influences sidebar

Martin König January 14, 2022

Hi All

I'm using a CSS-macro within the page to change the style of H2.

h2 {font-size: 25px!important; color: #000000!important;font-weight:500!}

Unfortunately the sidebar gets change as well. How can I prevent this?

Can anybody give me a tip on how to achieve this?

Thanks

ConfluenceCSSProblem.png

1 answer

1 vote
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 14, 2022

Your CSS style is being applied to all H2 elements on the page.  If you want it to only apply to certain elements you need to be more specific in the CSS.  If you add #main-content that should be enough to fix it.  So your CSS is 

#main-content h2 {font-size: 25px!important; color: #000000!important;font-weight:500!}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events