While using the seo template files during webdesign I found out I used the same CSS design tricks over and over again. They’re small things you can do to lift your website’s look tremendously. That’s why I’ve incorporated them in my seo template (a FREE website template zip package to give you a head start with your own webdesign).
Simple CSS Design Tips Overview
Use of borders for top and bottom
It wasn’t until I zoomed in on existing websites that I found out they used the “border” rule to ad shading to their div tags. Since then I’ve used it consistently in my own designs with all my main ID’s (#header, #banner, #content and #footer). As a general rule I create artificial lighting by making the border-bottom darker than the border-top. For example;
header {
border-bottom: 1px solid black;
}
banner {
border-top: 1px solid white;
}
For an added effect I almost always give the header, banner and footer ID background images being dark in the bottom and lighter in the top.
Use of text shadow
To add to the artificial lighting effect I use the text shadow. Mostly on the H-tags because they can diminish readability. I use a dark color in the upper right corner but more often a light color in the bottom left. For example
H1 {
text-shadow: –1px 1px white;
}
–1px 1px: stands for 1 pixel to the left and 1 pixel to the bottom
1px –1px: would stand for the opposite: 1px to the right and up
Use of Hover effects with links
Simple but very effective: hover effects. I always use them in this particular way to maintain consistency:
a:link,
a:visited {
color: black;
}
a:hover {
color: white;
}
Why this way? I’ve added the “visited” state so the links will not look purple when already clicked on in the past. Most of the time for usability and conversion purposes I also add the “text-decoration: underline” to the hover-state. I never use this when the link looks like a button because it has a background image.
a:link,
a:visited {
color: black;
}
a:hover {
color: white;
text-decoration: underline;
}
Only using “margin-bottom” to separate main styles
Less obvious but definately a css design tip is only using the margin-bottom to separate styles like H-tags with lists and paragraphs. This way you’ll ALWAYS know which style to target and don’t get confused how to make your text more readable or better looking with respect to other elements in the page. If you do a CTRL-F on “margin-top” you probably won’t even find any of those in my css template. Let’s say we want to divide an H1 tag with a subsequent paragraph which contains a list. My advice would be to do it always like this;
H1 {
margin-bottom: 20px;
}
p {
margin-bottom: 10px;
}
ul {
margin-bottom: 15px
}
Although the margins may very you’ll know that if you want to have more space between your heading and whatever follows you have to target the H-tag. Often times the H-tag will be the top element in some other containing ID. To give the H-tag (or anything else with it’s nose to the ceiling) some breathing space I give the containing ID padding:
#container {
padding: 20px 0;
}
H1 {
margin-bottom: 20px;
}
p {
margin-bottom: 10px;
}
ul {
margin-bottom: 15px
}
20px 0: means 20 to the top and bottom, 0 to the left and right. This makes coding your markup extremely easy and you’ll be able to achieve an extreme level of efficiency and quality in your CSS.
Take a look at the seo template to find a completely fleshed-out example of these CSS Design Tips.
Related posts: