Chris
Chris

Reputation: 12181

Importing .css into html document

I'm learning CSS/HTML and am trying to import a simple css class into the html document, but something appears to have gone awry. Here is Logo.css:

.logo{
  color:rgb(255,232,57);
  background-color:rgb(0,0,75);
  font:ChopinScript;
  font-size:96pt;
}

and my html document:

<head>
  <link rel="stylesheet" href="Logo.css" type="text/css">
</head>

<div class="logo">
  <p class="logo">This text should look like my logo!</p>
</div>
<img src="404-tumblebeast.jpeg" align=center valign=center />

The image shows up fine in Safari, but the text is just generic text. Does the link tag not import as I thought? How would I do the equivalent of #import or #include, if isn't taking care of that?

Upvotes: 1

Views: 7399

Answers (1)

DwB
DwB

Reputation: 38300

end the link tag (see below: the /> instead of >).

<link rel="stylesheet" href="Logo.css" type="text/css"/>

Verify that the Logo.css is in the same directory as the html file or use the correct path to the Logo.css file. Just in case you are doing this, you can't put the css under the WEB-INF directory.

You only need the class on the div element or on the p element, not both.

Edit: I was poking around and found some info about embedding fonts in a page: http://jonrohan.me/guide/css/font-face/

Upvotes: 2

Related Questions