943,553 Members | Top Members by Rank

Ad:
Jul 22nd, 2009
0

Checklist for CSS problems

Expand Post »
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
Similar Threads
Reputation Points: 6
Solved Threads: 0
Junior Poster
ggeoff is offline Offline
169 posts
since Aug 2007
Jul 22nd, 2009
0

Re: Checklist for CSS problems

or just use W3C CSS validator

http://jigsaw.w3.org/css-validator/
Reputation Points: 13
Solved Threads: 18
Junior Poster
MJ Pieterse is offline Offline
144 posts
since Mar 2009
Jul 22nd, 2009
0

Re: Checklist for CSS problems

Hi mj080,

Didn't know about the CSS validator. Should we use that first when encountering a problem?

Geoff
Reputation Points: 6
Solved Threads: 0
Junior Poster
ggeoff is offline Offline
169 posts
since Aug 2007
Jul 22nd, 2009
1

Re: Checklist for CSS problems

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
Reputation Points: 13
Solved Threads: 18
Junior Poster
MJ Pieterse is offline Offline
144 posts
since Mar 2009
Jul 22nd, 2009
0

Re: Checklist for CSS problems

Click to Expand / Collapse  Quote originally posted by mj080 ...
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
I altered the website back to the error and used the validator it didn't find that error but some in lightbox! I also checked the css with css Reports - I'm using Expression Web 2 and it found the error as an Unused Style. which indicates that the CSS in the page is not being applied - in this case due to the typo. The Unused Style errors of course may just be that unused styles. Thanks once again for your contribution.

Geoff
Reputation Points: 6
Solved Threads: 0
Junior Poster
ggeoff is offline Offline
169 posts
since Aug 2007
Jul 22nd, 2009
1

Re: Checklist for CSS problems

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: 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.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
Jul 22nd, 2009
0

Re: Checklist for CSS problems

Thanks midimagic that's brilliant!
Reputation Points: 6
Solved Threads: 0
Junior Poster
ggeoff is offline Offline
169 posts
since Aug 2007
Jul 29th, 2009
1

Re: Checklist for CSS problems

That's experience.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Centering popup images in an iframe
Next Thread in HTML and CSS Forum Timeline: How do i make a form that doesn't open the e-mail client?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC