| | |
Checklist for CSS problems
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2007
Posts: 97
Reputation:
Solved Threads: 0
Hi
I am still a newbie as far as using CSS is concerned. I had a problem, now resolved, where the CSS for part of my website was not working. I just couldn't see what was wrong! Eventually after a sleepless night and a search on the Web I solved the problem myself.
The reason it was not working was I had used #outerwrapper when I should have used #outerWrapper.
What I am proposing is to compile a checklist of errors and also some tips to avoid those errors. Here's a start.
1. check the spelling of each item very very carefully.
2. the CSS may be working but the effects may not be visible! set a bright background color.
3. use z-index to ensure that the content is not behind some other element.
4. when doing a web search use "syntax" as one of the search terms.
5. dont forget to use the forums- Daniweb is one of the best
Someone may know of a list, but I couldn't find it.
Geoff
I am still a newbie as far as using CSS is concerned. I had a problem, now resolved, where the CSS for part of my website was not working. I just couldn't see what was wrong! Eventually after a sleepless night and a search on the Web I solved the problem myself.
The reason it was not working was I had used #outerwrapper when I should have used #outerWrapper.
What I am proposing is to compile a checklist of errors and also some tips to avoid those errors. Here's a start.
1. check the spelling of each item very very carefully.
2. the CSS may be working but the effects may not be visible! set a bright background color.
3. use z-index to ensure that the content is not behind some other element.
4. when doing a web search use "syntax" as one of the search terms.
5. dont forget to use the forums- Daniweb is one of the best

Someone may know of a list, but I couldn't find it.
Geoff
•
•
Join Date: Aug 2007
Posts: 97
Reputation:
Solved Threads: 0
•
•
•
•
well, if you do have a problem that you can't solve, it will let you know where an error (or a couple) is on the CSS. It's mainly for when you are done with your site and you want to make sure that everything is in order, but i have had other uses for it
Geoff
There are two kinds of css failure:
1. The css has errors in it that prevent correct rendering.
2. The css renders, but not the way the page creator wants.
1. Look for the following css errors if the css does not render:
- Look for typogoofical errors first.
- On Firefox, use the error console. It will tell you the line containing any syntax error.
- Make sure you spelled the classes and ids the same in all references.
- Make sure you didn't use the same name for two different classes or ids.
- Make sure you didn't use an id twice.
- Make sure that there are no units of measure on 0 values. Some browsers do not allow them.
- No special characters in classes and ids.
- Beware of deprecated and browser-specific styles and properties.
2. Look for the following if the css does not render the way desired:
- Remember that the surrounding styles (margin, border, padding) are rendered OUTSIDE any box object. Leave enough space for them to fit.
- If something intended for the same row renders below the row, it probably does not fit in the remaining space.
- Don't put size styles (width, height), and surrounding styles in the same style or tag. This is the key to inter-browser compatibility.
- Is the div shrinking, instead of containing the contents? Use the style:
- Note that some displays do not differentiate colors that are close to each other.
- If you expect compatibility across different screen resolutions, use % and em to set sizes. The styles cm, in, and pt set a size based on an average display, but don't always work on the display you have. The px style makes the object change size with the screen resolution, covering different parts of the browser pane on different computers.
- Don't expect to exactly fill the browser pane vertically. It can't be done in a way that works on all computers, resolutions, aspect ratios, browsers, and restored-down window dimensions.
- Check to see if a style you do not want is inherited from a containing object. If it is, you will have to make another style for the inheriting object that cancels the inherited style.
- Always specify text-align and vertical align for all table cells. IE and FF have different defaults for these.
- Don't use absolute or fixed location. They do different things on different browsers.
- Don't use negative values for sizes. They do different things on different browsers.
- Remember that a repeated image may be incomplete at the edge of the repetition.
- Don't expect everything to look exactly the same on different browsers.
- Don't expect z-axis to always work. Some objects expect to always be on top.
1. The css has errors in it that prevent correct rendering.
2. The css renders, but not the way the page creator wants.
1. Look for the following css errors if the css does not render:
- Look for typogoofical errors first.
- On Firefox, use the error console. It will tell you the line containing any syntax error.
- Make sure you spelled the classes and ids the same in all references.
- Make sure you didn't use the same name for two different classes or ids.
- Make sure you didn't use an id twice.
- Make sure that there are no units of measure on 0 values. Some browsers do not allow them.
- No special characters in classes and ids.
- Beware of deprecated and browser-specific styles and properties.
2. Look for the following if the css does not render the way desired:
- Remember that the surrounding styles (margin, border, padding) are rendered OUTSIDE any box object. Leave enough space for them to fit.
- If something intended for the same row renders below the row, it probably does not fit in the remaining space.
- Don't put size styles (width, height), and surrounding styles in the same style or tag. This is the key to inter-browser compatibility.
- Is the div shrinking, instead of containing the contents? Use the style:
display: table-cell; - Note that some displays do not differentiate colors that are close to each other.
- If you expect compatibility across different screen resolutions, use % and em to set sizes. The styles cm, in, and pt set a size based on an average display, but don't always work on the display you have. The px style makes the object change size with the screen resolution, covering different parts of the browser pane on different computers.
- Don't expect to exactly fill the browser pane vertically. It can't be done in a way that works on all computers, resolutions, aspect ratios, browsers, and restored-down window dimensions.
- Check to see if a style you do not want is inherited from a containing object. If it is, you will have to make another style for the inheriting object that cancels the inherited style.
- Always specify text-align and vertical align for all table cells. IE and FF have different defaults for these.
- Don't use absolute or fixed location. They do different things on different browsers.
- Don't use negative values for sizes. They do different things on different browsers.
- Remember that a repeated image may be incomplete at the edge of the repetition.
- Don't expect everything to look exactly the same on different browsers.
- Don't expect z-axis to always work. Some objects expect to always be on top.
Last edited by MidiMagic; Jul 22nd, 2009 at 4:11 pm.
Daylight-saving time uses more gasoline
![]() |
Similar Threads
- css problems with left col/menu (HTML and CSS)
- CSS Problem need help! (HTML and CSS)
- CSS Problems (HTML and CSS)
- height: 100% - cannot get this to work (HTML and CSS)
Other Threads in the HTML and CSS Forum
- Previous Thread: Centering popup images in an iframe
- Next Thread: How do i make a form that doesn't open the e-mail client?
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






