Jump to content

Fonts


Guest Webclown

Recommended Posts

Guest Webclown

Hi there, I've downloaded a font called Child's Play.ttf on my harddrive it looks nice, but as soon as I upload the stuff it shows some other font. Is there a code to refer to this file?please help me out

Link to comment
Share on other sites

You should be able to set the font-family as:

<body style="font-family: 'child's play', sans-serif">

I can't be certain that'd work though, the problem occurs from the apostophy. You could remove it from the file name. Or you could use an external style sheet and do something like:

body{   font-family: "child's play", sans-serif;}

That should work without removing the apos. However, if you are viewing the site on a PC without the font installed, your browser will default to the second font family you add.

Link to comment
Share on other sites

You can use special characters in style sheets inside the document's head with CDATA and XHTML.

<script type="text/css"><![CDATA[body {   font-family: "Child 39;s Play", sans-serif;}]]></script>

You might want to use & #39; (without space) since ' is XML and won't work with IE.Also, try to avoid inline style (style attribute) especially with elements that appear only once per page or in every page.

Link to comment
Share on other sites

Just in case you don't already know this, if you're going to show the website to anyone else, the font wont show up. The browser will just default to another font. There is a way around this with IE if you download some special package from microsoft that converts the font into a file that the viewer can download temporarily for viewing your website. If your interested, I'll try to find that again.

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...