CSS Tips / PDF
Sample of the pdf document :
1)
Always use a
Doctype declaration:
i.e.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I’d recommend XHTML 1.0 transitional. Strict is very strict, you can’t even use
target=”_blank”
The
Doctype affects how the page renders.
Use the same one to avoid CSS properties changing depending on
doctype. i.e. no Doctype changes the affect of * {margin: 0; padding: 0} etc.
2)
If margin doesn’t work, try padding. Margin on the top of an object can actually
push a DIV down etc.
3)
If you are having trouble with inheritance in your stylesheet
you can override it with the important! Rule:
i.e. input
{background-color: #fff !important}
4)
Start on the right foot.
If you are able to set some key styles at the start of the stylesheet
then you will have a shorter stylesheet that is easier to manage and easier to
diagnose problems:
i.e * {margin: 0;
padding: 0; border: 0; font-family: Arial, Helvetica, sans-serif}
ol,
ul {font-size: 0.75em; margin-left: 25px}
5)
Beware of ems. ems are a good unit because they resize in
Internet Explorer when you increase text size.
px values don’t, so as a result the website will fail one of the most
basic of Accessibility requirements.
However, ems can be a pain to work with if you are not aware of
what they are doing.
For example.........
Click here for Download PDF / FREE
0 commentaires: