10 Often Made CSS Mistakes
I thought I would give a list of the mistakes which I often make. I assume a lot of people make the same ones and it can often cause your whole design to mess up.
So go through the checklist if you have a problem with your design and it might be one of the following
-
Forgetting to clear floats.
After you float your columns you need a clearing div so that your wrapped container expands vertically -
Leaving out the margin:0 on heading tags.
This can often push things far apart when near your heading tags. -
Having the width of an element but not taking into account padding.
This is one of my classic errors. I set a column width 250px which fits perfect with the other column but then add padding left or right and don't change the width. This is sorted by taking the padding amount away from the width. -
Not giving a visited attribute for links.
All looks good at first then suddenly your links turn to the default blue colour. Remember to put visited attributes on your links. -
Not closing a div.
Yep it happens to the best of us. It can throw the whole template out of sync and cause huge problems. -
Not including "#" on your colour attributes.
Its easy to do but can have you looking for the problem for a while. Will cause the colour not to show up in some browsers. -
Typing id differently in CSS file and HTML file..
This is the most frustrating one as after you have worked it out you will be kicking yourself. -
Spelling an attribute incorrectly.
Yet another simple mistake to make. This could be as simple as typing backgrond by accident. This will cause the attribute to be ignored. -
Leaving out the ending semi colon.
I usually only do this if I edit something and remove a line and accidentally take the semi colon away. This will cause a number of attributes to be ignored. -
Forgetting outline attributes on input fields and buttons.
I made this mistake a lot when I first started to code. It will cause a border often unwanted around submit buttons.



