CSS font stacks & developer FAQs with Web standards

WestNIC provides reliable web hosting services

Fastwebhost offers cheap web hosting & reseller hosting services

Site navigation below

This FAQ is part of the Code Style Help and FAQ section. Join our premium content service for full access all FAQ answers.

What if you were One Percent Better with Cascading Style Sheets? Cascading Style Sheets FAQ ebook for iPad, Kindle, Nook and Sony Reader

CSS authoring issues

Q: Why do I get horizontal scrolling?

A: The width any element is made up of the following CSS properties...

… full answer hidden, click for full answers

Premium members click below for full answer
Why do I get horizontal scrolling?

Q: My style sheet does not show on my form confirmation page!

A: You are probably using a relative path reference for your CSS, which does not resolve correctly on your results page. For instance, if you have a form located at ...

… full answer hidden, click for full answers

Premium members click below for full answer
My style sheet does not show on my form confirmation page!

Q: My fonts are too small on Mac!

A: Without seeing your page, this is all guess-work, but you are probably using px or pt units for your font-size values. Mac OS browsers and screen configurations generally result in font sizes that are relatively smaller than on Windows systems for these length units. In any case, it is more appropriate to use % or em length values for fonts on the World Wide Web and this will allow users to adjust font sizes to their preferences using their browser font settings.

Q: What can I do if my CSS file is corrupted?

A: If your CSS file is corrupted, you will need to recover a copy from a backup version of some kind. Many text editors create a backup when you edit a file; the application's configuration settings may indicate where you can find the backup.

… full answer hidden, click for full answers

Premium members click below for full answer
What can I do if my CSS file is corrupted?

CSS browser issues

Q: Why is my site messed up on other computers when the CSS is the same?

A: In the early days of Cascading Style Sheets the implementation of standard style properties, especially layout properties was quite erratic amongst different Web browsers. These days the implementation of CSS in Web browsers is generally very good and reasonably consistent amongst all the major browser vendors. There are still some known errors and inconsistencies amongst browsers but syntax errors in your HTML and CSS code are more likely to be the cause of major layout problems.

Modern Web browsers are designed to tolerate HTML syntax errors, but the way they adapt to incorrect markup may well cause differences in the document structure that is rendered to different browsers. The HTML structure of a document can have a significant effect on the CSS that is applied to it. First, CSS contextual selectors use the nesting of specific elements to decide whether to apply a given style. Secondly, the width, margin, padding and border applied to selected elements affects the overall layout of the page. Browsers may remove or restructure bad HTML element structures that are critical to the composition of the page.

Web browsers are also designed to tolerate CSS syntax errors, but their approach is likely to be more strict than with HTML, they will tend to ignore un-recognised or invalid keywords, property names and values. A missed semi-colon may cause a number of style declarations to be ignored, which can have a significant impact on the overall layout of a page.

You should validate and correct all HTML and CSS syntax errors before you investigate any apparent browser compatibility problems. It is impossible to fix bogus browser bugs that actually exist in your own code. See these Code Style articles:

Q: My styling works in Firefox but not in IE!

A: You should validate and correct your XHTML and CSS before you ask questions like this. Follow these links for details of online markup validators and CSS syntax checkers.

You can also validate your markup on your computer, see Validate your markup with NSGMLS.

Q: My link colours don't work in IE8!

A: When you get problems like this you should validate your CSS to rule out syntax errors. In this case, you will find that the colour “tan” is not a legitimate CSS colour value. You will also get warnings that you should specify a background colour for each of your foreground colour declarations.

Use the W3C CSS validator installation guide to set up a local syntax checker.

Home · Web fonts · Font stacks · FAQs · Java · CSS · Javascript · HTML · Site manager