fonts and styles

E

Erik Abels

I am kinda new with frontpage and html. i have written a header file to be applied to all pages within the site. My problem is that the formatting of links from each individual page in overriding my formatting of links on my header.html file. I know that you can use styles to change it and it works but when i rollover the link, the font-face changes and I cannot seem to get that to stop. Any advice or direction would be greatly appreciated.

Thanks for your help
Erik Abels
 
A

Andrew Cushen

Erik:

Try using a style rule like this to set the rollover font to what you want:

(assuming you want Arial, and that if Arial's not on the user's pc you want Helvetica. Change this to whatever font you want)

a:hover {
font-family: Arial, Helvetica, sans-serif;
}

Put this in the referenced external style sheet.

If that doesn't help, you probably have a problem with the order your rules are cascading in. Inline styles - styles that are in the tag of the actual item - will always override external rules. So if you have a rule like this:

<h1 style="color: red">

this will override any style for the h1 element that is in an external stye sheet. If this is the case, you have no choice but to edit the individual html files and remove or change the offending styles. This is why it's always best to put your styles in a separate stylesheet file from the beginning, unless you are ABSOLUTELY SURE you will only need one or two styles and that they will only be in 1 file. The problem is that as you add pages over the life of your site, what you were absolutely sure of at the start, will often no longer apply. So do yourself a favor and use external style sheets from the start!

Also, if you have an embedded style (a style that is within the html file itself, not in an external file) that comes after your link to the external stylesheet, that embedded style will have priority. So if you have the following in your html file:
-----------------------------------------------------------------------
<link rel="stylesheet" href="myStyles.css">

<style type="text/css" etc. etc.>
-----------------------------------------------------------------------
and they both set the font for the mouseover of the link, the one that comes later- the embedded one, in this case, NOT the external one- wins. Just swap them around, putting the <link> one last, and you'll solve this problem.

HTH,

-Andrew
================================================

-Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top