Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing <H1> Font size and color in CSS

Status
Not open for further replies.

senglish

Programmer
Nov 4, 2002
19
AU
I am trying to change the Font size and color in a CSS for the <H1> tag and I cannot make it change. Strikethrough or underline or background color all work fine so I obviously am accessing the correct CSS. Is it possible to change these attributes please? I am using the MS development environment and this is the code

H1
{
FONT-WEIGHT: bold;
FONT-SIZE: 8pt;
COLOR: red;
FONT-FAMILY: verdana, arial, sans-serif
}
Thanks
Stephen
 
I just tested it and it works...
This is a dumb question, but did you enclose the style in an <style></srtyle> tags??
This is what I did on my test page and it worked...

<html>
<head>
<style>
H1 {FONT-WEIGHT: bold;
FONT-SIZE: 24pt;
COLOR: red;
FONT-FAMILY: verdana, arial, sans-serif
}
</style>
</head>

<body>
<h1>HI, this is a test!! This is an h1 tag</h1>
HI, this is a test!! This is not in an hi tag
</body>
</html>
I have not failed; I have merely found 100,000 different ways of not succeding...
 
Thank you. This works for me too but I was trying to set it in an external stylesheet. However, this is a great workaround, thank you.
 
The external style sheet still works...
Take the style code and put them in an external file and call that file on all HTML pages, like: <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;myCSSstyle.css&quot;>
Put that code on all HTML pages that call that style sheet in the <head> section... I have not failed; I have merely found 100,000 different ways of not succeding...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top