Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In CSS how do you change font size of h1 and h2

In a WordPress twenty eleven theme. I want to change the size of headings When I wrap my headings around h1 and h2 tags as follows

<h1>My h1 heading </h1>
<h2> My h2 heading </h2>

The font size of heading in the theme I am using is almost same as content's font except that they are bold. So my headings are not quite prominent.

I guess I would need to change something in the CSS file. Please advise what exactly in need to put in.

like image 746
Ahmed Avatar asked May 19 '12 19:05

Ahmed


People also ask

What is the font size of H2?

H2: 26 pt (24–28pt) H3: 22 pt (20–24pt) H4: 20 pt (18–22pt)

How do you change text size in CSS?

To change the size of your text with inline CSS, you have to do it with the style attribute. You type in the font-size property, and then assign it a value.


3 Answers

h1 {
  font-weight: bold;
  color: #fff;
  font-size: 32px;
}

h2 {
  font-weight: bold;
  color: #fff;
  font-size: 24px;
}

Note that after color you can use a word (e.g. white), a hex code (e.g. #fff) or RGB (e.g. rgb(255,255,255)) or RGBA (e.g. rgba(255,255,255,0.3)).

like image 88
Bram Vanroy Avatar answered Oct 13 '22 21:10

Bram Vanroy


 h1 { font-size: 150%; }
 h2 { font-size: 120%; }

Tune as needed.

like image 24
Jukka K. Korpela Avatar answered Oct 13 '22 23:10

Jukka K. Korpela


What have you tried? This should work.

h1 { font-size: 20pt; }
h2 { font-size: 16pt; }
like image 6
recursive Avatar answered Oct 13 '22 22:10

recursive