Jump to content

Font problem


Mantz

Recommended Posts

Hey thereI got a strange question. I tried to use an external Font on my Webpage and it works perfect for p, but when I try to use it for any header (eg. h1) it just won't work. Can anyone tell me why, and what I could do about it?Here is an example from the w3schools page which I changed a bit so one can see my problem<html><head><style type="text/css">h3 {font-family: "Edwardian Script ITC"} //Here is the problem, it just shows the default fontp {font-family: "Edwardian Script ITC"}p.sansserif {font-family: sans-serif}</style></head><body><h3>This is header 3</h3><p>This is a paragraph</p><p class="sansserif">This is a paragraph</p></body></html>Thanx already

Link to comment
Share on other sites

Have you tried attaching a class or id to your <h3> tag and css? like:css:

h3.header {font-family: "Edwardian Script ITC"}

html:

<h3 class="header">This is header 3</h3>

Try that and see if that helps.

Link to comment
Share on other sites

you've missed out a ';' on the end of your css lines. I've also been told/read that, fonts shouldn't have the " around them. It should read like this:

<style type="text/css">h3 {font-family: Edwardian Script ITC;} //Here is the problem, it just shows the default fontp {font-family: Edwardian Script ITC;}p.sansserif {font-family: sans-serif;}</style>

:)

Link to comment
Share on other sites

I did try it with a class, but it still doesn't work. I just keep on trying difernt ways. Otherwise I'll just do it the hard way, and change it in each page...

Have you tried attaching a class or id to your <h3> tag and css? like:css:
h3.header {font-family: "Edwardian Script ITC"}

html:

<h3 class="header">This is header 3</h3>

Try that and see if that helps.

This doesn't change anything. It most be something else. But thanks for trying.
you've missed out a ';' on the end of your css lines. I've also been told/read that, fonts shouldn't have the " around them. It should read like this:
<style type="text/css">h3 {font-family: Edwardian Script ITC;} //Here is the problem, it just shows the default fontp {font-family: Edwardian Script ITC;}p.sansserif {font-family: sans-serif;}</style>

:)

Link to comment
Share on other sites

Thanx for all your help. I just figured it out. It was a Browser Problem. Safari is just too picky. Since it isn't allowed to use any other font than the standarts, the Safari just won't show it right. So I just mad a p.header class and it works fine now.CheersMantz

Link to comment
Share on other sites

I've also been told/read that, fonts shouldn't have the " around them.
W3C recommends (try validating) putting quotes if they contain whitespace, for example Times New Roman should be "Times New Roman". This is because if a font were to contain more than 1 consecutive white space, for example
imaginary  font

, without the quotes it would be rendered as

imaginary font

. I don't know if there is a font like this, but it's W3C recommended.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...