Font Styles

T

The Doctor

I'm very new to HTML & I'm struggling a bit with styles.

<html>
<head>
<title></title>
<STYLE TYPE="text/css">
<!--
H2
{
color:blue;
font-family:arial;
font-size:20pt;
}
-->
</STYLE>

</head>
<body>
<h2>Education</h2>
</body>
</html>

My understanding of that code is that it will show the word
"Education" in Arial regular, blue, 20 pt.
Instead I get the word "Education" in Arial Bold. How do I
turn the Bold option off?
 
E

Els

The said:
H2
{
color:blue;
font-family:arial;
font-size:20pt;
}
[snip]

My understanding of that code is that it will show the word
"Education" in Arial regular, blue, 20 pt.

No, h2 has font-weight:bold by default.
Instead I get the word "Education" in Arial Bold. How do I
turn the Bold option off?

font-weight:normal;
 
N

Nikita the Spider

"The Doctor said:
I'm very new to HTML & I'm struggling a bit with styles.

<html>
<head>
<title></title>
<STYLE TYPE="text/css">
<!--
H2
{
color:blue;
font-family:arial;
font-size:20pt;
}
-->
</STYLE>

</head>
<body>
<h2>Education</h2>
</body>
</html>

My understanding of that code is that it will show the word
"Education" in Arial regular, blue, 20 pt.
Instead I get the word "Education" in Arial Bold. How do I
turn the Bold option off?

Els has already answered your question, I just wanted to add in that
points (pt) are fine for printing but aren't a great measurement unit
for screens. Try ems or percentages instead, like so:

h2
{
color:blue;
font-family:arial;
font-size: 125%;
}
 
J

jojo

Nikita said:
H2
{
color:blue;
font-family:arial;
font-size:20pt;
}
[snip]

I just wanted to add in that points (pt) are fine for
printing but aren't a great measurement unit for
screens. Try ems or percentages instead, like so:

h2
{
color:blue;
font-family:arial;
font-size: 125%;
}

There is still something to add: I would specify a generic font-family
in addition to the font-type (would be "sans-serif" in case of Arial).

So your CSS-class would be:

h2
{
color:blue;
font-family:arial, sans-serif;
font-size: 125%;
}

for more information about generic font families see:
http://www.w3.org/TR/REC-CSS2/fonts.html#generic-font-families

jojo
 
T

The Doctor

tya

jojo said:
Nikita said:
H2
{
color:blue;
font-family:arial;
font-size:20pt;
}
[snip]

I just wanted to add in that points (pt) are fine for
printing but aren't a great measurement unit for screens.
Try ems or percentages instead, like so:

h2 {
color:blue;
font-family:arial;
font-size: 125%;
}

There is still something to add: I would specify a generic
font-family in addition to the font-type (would be
"sans-serif" in case of Arial).

So your CSS-class would be:

h2
{
color:blue;
font-family:arial, sans-serif;
font-size: 125%;
}

for more information about generic font families see:
http://www.w3.org/TR/REC-CSS2/fonts.html#generic-font-families

jojo
 
J

Jukka K. Korpela

Scripsit The Doctor:
I'm very new to HTML

That's obvious from the code snippets you posted.
& I'm struggling a bit with styles.

Just stop that. Learn HTML first.
<title></title>

For example, that's bad authoring. Very bad.
<STYLE TYPE="text/css">
<!--

And that's just worse than pointless technobabble that stopped being
relevant about a decade ago.
My understanding of that code is that it will show the word
"Education" in Arial regular, blue, 20 pt.

Maybe, maybe not. It depends. But 20 pt is a wrong setting anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top