[HTML Beginner] Need Help on External Style Sheet

skellerklunch

Beta member
Messages
1
Location
Japan
Hello, it's only been a few hours since I've started learning HTML.
For this reason, my issue is completely due to my ignorance and stupidity.
I apologize in advance.

I've encountered a problem in which: when I open my .html file in firefox, I don't seem to get the color and font size I had wanted. I'd greatly appreciate any help provided. I use the free CoffeeCup HTML Editor, and the two files Untitled.html and Untitled2.html are in the same file. The if IE then ... code was provided via CoffeeCup as default.

Here is the code for the Untitled.html:
Code:
<!DOCTYPE html>

<html lang="en">
 <!--[if IE]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  <head>
  <title> My First HMTL Website </title>
  <link rel="stylesheet" href="Untitled2.css">
  </head>
  <body>
  <p><h2>This is a very basic HTML page.</h2></p>
  <p><h3>This page can not yet be accessed by other computers.</h3></p>
<br>
<br>
© Jun Oikawa
  </body>
</html>


Here is the code for Untitled2.css:
Code:
h1 {font: georgia 14pt bold;
    color: #6666FF}
h2 {font: georgia 12pt bold;
    color: #6666FF} 
h3 {font: georgia 11pt bold; 
    color: #6666FF}
b  {color: #FF6600} 
quote {font: georgia 10pt;
       color: #6699cc;
       line-height: 16pt}
 
Last edited by a moderator:
Did you specify the src folder of your stylesheet?

also you're missing some semi-column in your .css
 
Code:
h1 {
     font: georgia 14pt bold;
     color: #6666FF;
}
h2 {
     font: georgia 12pt bold;
     color: #6666FF;
} 
h3 {
     font: georgia 11pt bold; 
     color: #6666FF;
}
b  { color: #FF6600; } 
quote {
     font: georgia 10pt;
     color: #6699cc;
     line-height: 16pt;
}

You have to add semicolons at end of each statement. See the difference in above example?
 
Yep, semi colons are needed.

I wouldn't count on that. Although semicolons are definitely needed most of the time, I believe they aren't needed for the last style in a rule. I'd try going into developer tools (CTRL-SHIFT-J should work in Chrome and Firefox), going to the elements tab, finding one of the H1 elements, and looking on the right panel to see if styles are applied.
 
I wouldn't count on that. Although semicolons are definitely needed most of the time, I believe they aren't needed for the last style in a rule. I'd try going into developer tools (CTRL-SHIFT-J should work in Chrome and Firefox), going to the elements tab, finding one of the H1 elements, and looking on the right panel to see if styles are applied.

A shorter shortcut to Crtl+Shift+J... Just press F12 ;). Brings up the dev tools to the Elements tab by default.
 
Back
Top Bottom