Hi. I want to change the background colour of heading tag H2 or H3 etc in my Wordpress post. There is section on right side of post editor where we can put advanced CSS for any customised changes.
Can anyone please help me what CSS code should I put there for this purpose.
If you want to add a background color to your heading tag H1, H2, H3, H4 use this:
<!DOCTYPE html>
<html>
<head>
<title>HTML Font Color</title>
</head>
<body>
<h1 style="background:#FFAAAA">Tis is an example of HTML H1 background Color</h1>
<h2 style="background:#FFAA0A">Tis is an example of HTML H2 background Color</h1>
<font color="red">Nere is my text! with font color color_name useing: color="red" </font> <br />
<font color="#0099FF">Nere is my text! with font color hex_number useing: color="#0099FF" </font> <br />
<font color="rgb(30, 45, 12))">Nere is my text! with font color rgb_number useing: color="rgb(30, 45, 12))" </font><br />
</body>
</html>
It would probably be easiest to add a unique classname to that particular h2 tag and apply @Gandalf’s CSS code with that classname to target that h2 tag. For example
<h2 class="uniqueclassname">SAP S4 HANA Finance</h2>
h2.uniqueclassname { background-color: red; }
If you do not know how to do this using your Wordpress tools, we can move this post to the Wordpress category for you.
Without seeing your actual code… and after writing the above response, I realized that although you are talking about an <h2> tag, the red text is shown as normal inline text and should not be coded as a block <h2>. It would be far more appropriate if the text were surrounded by <span> tags and the unique classname applied to the span tags.