Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing color of h2 [closed]

Tags:

html

How I can change the color of h2 ?

I have tried <h2 color="#006699">Process Report</h2> but it's not changed and I am still getting this default black colour

Thanks .

like image 552
Night Walker Avatar asked Dec 30 '11 22:12

Night Walker


People also ask

What is the correct representation to change the Colour of H2 element?

Option #2: Use CSS selectors When there's a space, the selector h2 . red-text is telling the browser to target the element with the class red-text that's child of h2 . However, the H2 element doesn't have a child – you're trying to style the H2 element itself.

What is the color of H2?

But isn't hydrogen a colourless gas? Yes, hydrogen is an invisible gas.

How do I change the H2 color in Wordpress?

You could go to or use the source-view of the post (when editing). Then find the <h1> <h2> or any heading element you want to change its color, then style it by e.g: <h3 style="color: red;">Heading 3</h3> for example.

How do you change the color of text in HTML?

To set the font color in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property color. HTML5 do not support the <font> tag, so the CSS style is used to add font color.


2 Answers

Try CSS:

<h2 style="color:#069">Process Report</h2>

If you have more than one h2 tags which should have the same color add a style tag to the head tag like this:

<style type="text/css">
h2 {
    color:#069;
}
</style>
like image 110
rekire Avatar answered Oct 29 '22 21:10

rekire


If you absolutely must use HTML to give your text color, you have to use the (deprecated) <font>-tag:

<h2><font color="#006699">Process Report</font></h2>

But otherwise, I strongly recommend you to do as rekire said: use CSS.

like image 45
Michiel van Oosterhout Avatar answered Oct 29 '22 21:10

Michiel van Oosterhout