How can I add CSS to Form Custom HTML field to change font-size

Confluence User - 27 Jul, 2022

The suggested CSS addition to a Custom HTML field here

Custom HTML

will not change the form font-size but the font size buttons on the Userview will do so.

How can I add CSS to the form that will default it to a larger font size. If I place the color attribute within the suggested CSS it seems to be effective as does the padding attribute but the font-size attribute has no effect. Please advise.

Thanks, Bill

forms;userviews

1


28 Jul, 2022
confluenceUser
confluenceUser

Hi, Bill. If you look at the figure below, it's because the class id #form-canvas precedes element <p>

So if you want to change all the text in the form to become bigger, you can re-defined the class-id specifications


<style type="text/css">
#form-canvas *{
 font-size: 32px;   
}
</style>
<span id="form-canvas">This is a sample text.</span>


And if you just want the custom html text to become bigger, remove the *.


<style type="text/css">
#form-canvas {
 font-size: 32px;   
}
</style>
<span id="form-canvas">This is a sample text.</span>


If for whatever reason you wish to change the font-size of, well, a lot of things like this ü can try out adding !important


<style type="text/css">
span{
 font-size: 32px !important;   
}

</style>
<span>This is a sample text.</span>


If you are interested in learning more about the html, you can try to go through these

https://www.w3schools.com/cssref/pr_font_font-size.asp

https://www.w3schools.com/cssref/css_selectors.asp

https://www.w3schools.com/css/css_selectors.asp

https://stackoverflow.com/questions/25105736/what-is-the-order-of-precedence-for-css

Hope it helps!

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print