CSS Tips

There are many css tips and tricks to make your web look good.These just some of them...

1.Letting Users Control Font Size

Try to avoid specifying the body font size. Don’t do this, for example:
body {font-size: 24px;}

People have set their browser’s options to a text size that’s readable for them. You don’t know whether they’ve got a pixel resolution of 1680x1050 or 800x600 pixels. It makes a difference. The user should be the one to decide this issue, not you.


2.Making Sure Your Borders Show Up

Here’s a common head CSS programming head-scratcher:
p {border: 12px;}

In spite of this rule that you wrote, no border shows up around the paragraphs. You’d logically think that by specifying a border size, you’d see a border. Not so. Unless you also specify a border style, you don’t get a border. The default style is none, so change it to include a style:
p {border: solid 12px;}


3.Watching Out for Color Clash

What if you specify a text color, but fail to specify a background color? Sounds harmless, but it can be a problem. Some users employ personal style sheets, including their favorite colors. What happens if a user specifies brown for their backgrounds and white for their text? Say that you specify brown for your text:
BODY {color: brown;}

The user won’t see your text at all because their background color and your foreground (text) color are identical. The solution? Always specify a back- ground if you’re going to color the text. Then you have control over how the text looks against that background:
BODY {color: brown; background-color: yellow;}

good luck!!!