14 replies [Last post]
cbsdata
Offline
newbie
Last seen: 18 years 46 weeks ago
Joined: 2004-05-07
Posts: 7
Points: 0

I have designed a stylesheet to create mutlitple buttons on one of my sites. I know that the page is able to "read" the stylesheet, because some of the elements are present. However, the font will not show up as what I've designated. Since I don't have a font specified in the actual HTML of the page, I believe the different computers are displaying the font they are set to display if a font is not set. How can I get the font in my stylesheet to display properly on different computers? I've tried it on 4 computers, it shows up different on all 4. Is there a setting I need to change on my web server? Any suggestions would be appreciated!

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 50 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Fonts are not displaying properly

The way we can tell what's going on is by seeming a link. If no link is a available, then the HTML/CSS.

There are many possibilities for why it is not working Wink

The next sentence is true. The previous sentence is false. Discuss...

Daybreak_0
Offline
Enthusiast
Sydney, Australia
Last seen: 19 years 19 weeks ago
Sydney, Australia
Timezone: GMT+10
Joined: 2003-11-15
Posts: 389
Points: 0

Fonts are not displaying properly

If you have designated a font in your CSS or html then that is the font that will be used

body {font-family: verdana, arial, helvetica, "sans serif";}

If you do not designate a font then the browsers default font will be used, as set under options.

But, If you designate a non-standard font and the computer you are using does not have that font, then the default font will be used, as the computer does not have the font you specified.

So
a) Always use standard fonts
b) Provide Alternatives as per above.

Hope that helps

Regards
Day

The only way to learn is to do it yourself

cbsdata
Offline
newbie
Last seen: 18 years 46 weeks ago
Joined: 2004-05-07
Posts: 7
Points: 0

Fonts are not displaying properly

This is the code that creates the original buttons. I also have coding for a hover state, but the font does not change in that state. As you can see, I have no font assigned to the body of the page, because I am only using this sheet to create buttons. Do I need to assign a font for the body, as well as for the buttons?

div.menuBar,
div.menuBar a.menuButton {
font-family: Verdana, Arial, sans-serif;
font-size: 8pt;
color: #000000;
}

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 50 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Fonts are not displaying properly

The code seems present and correct. The only point I'd make is that you're using pts instead of a screen-based size (points are only useful for print specific font sizing, using something like pixels or %). It could be that the pt sizing is giving different sizes rather than different fonts across browsers?

Can you post a screen shot or two of the pages that have different fonts? Are they different fonts entirely (such as Times instead of a sans-serif). Or is something more subtle?

The next sentence is true. The previous sentence is false. Discuss...

cbsdata
Offline
newbie
Last seen: 18 years 46 weeks ago
Joined: 2004-05-07
Posts: 7
Points: 0

Fonts are not displaying properly

I don't have screen shots, but they are showing in Times, not a sans-serif.

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 50 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Fonts are not displaying properly

Can you post all your HTML/CSS then? (At least all the CSS.) You may have a character that's stopping the CSS rule working (typically an errant ; or } can cause this). You can test this by putting something obvious on the offending rule such as a red border or background.

Can't really speculate further until we see the code I'm afraid.

The next sentence is true. The previous sentence is false. Discuss...

cbsdata
Offline
newbie
Last seen: 18 years 46 weeks ago
Joined: 2004-05-07
Posts: 7
Points: 0

Fonts are not displaying properly

Here is the entire css

<style type="text/css">
div.menuBar,
div.menuBar a.menuButton {
font-family: Verdana, Arial, sans-serif;
font-size: 12px;
color: #000000;
}

div.menuBar {
background-color: #FFFFFF;
text-align: left;
margin-left: 0px;
}

div.menuBar a.menuButton {
font-size: 8pt;
background-color: transparent;
border: 0px solid;
border-color: #f0f0f0 #909090 #909090 #f0f0f0;
color: #000000;
cursor: pointer;
left: 0px;
margin: 0px;
position: relative;
text-decoration: none;
top: 0px;
z-index: 100;
}

div.menuBar a.menuButton:hover {
background-color: transparent;
border-color: #909090 #f0f0f0 #f0f0f0 #909090;
color: #5B6CB1;
}

</style>

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 50 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Fonts are not displaying properly

The the code with some simply HTML, is it still the wrong font? I haven't amended anything yet:

http://pub.c-o2.net/cssf/cbsdata.htm

The next sentence is true. The previous sentence is false. Discuss...

cbsdata
Offline
newbie
Last seen: 18 years 46 weeks ago
Joined: 2004-05-07
Posts: 7
Points: 0

Fonts are not displaying properly

This looks correct when I view it on my computer.

Part of the problem is when I transfer the pages/sheets to my web server. Things will work perfectly on my pc, but not when they are on the web servers.

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 50 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Fonts are not displaying properly

Hmm, it may be a file transference problem. So, the files are working fine (the font showing I mean) on your local PC? But from viewing on your server after upload, they don't?

How do you transfer your files to the web server? FTP?

There are normally some settings for file transfers to FTP sites, these are binary, and ASCI. Try swapping from the usual setting.

The next sentence is true. The previous sentence is false. Discuss...

cbsdata
Offline
newbie
Last seen: 18 years 46 weeks ago
Joined: 2004-05-07
Posts: 7
Points: 0

Fonts are not displaying properly

It's just a copy/paste process to transfer to the web server at work, no FTP.

Everything looks great on my computer, but anywhere else, it doesn't work.

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 50 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Fonts are not displaying properly

What machine are you working on? Which application are you using? Which server are you copying across to?

The next sentence is true. The previous sentence is false. Discuss...

cbsdata
Offline
newbie
Last seen: 18 years 46 weeks ago
Joined: 2004-05-07
Posts: 7
Points: 0

Fonts are not displaying properly

I am using Dreamweaver to develop the pages and then copying to a server running Windows 2000 Advanced Servers running IIS 4, if that helps

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 50 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Fonts are not displaying properly

Check to see if you have it set to Unix line breaks. If so, swap it to Windows (in DWMX preferences). Don't think this'll be the cause, but worth a try.

The next sentence is true. The previous sentence is false. Discuss...