10 quick tips to help make your CSS coding pain-free
10 quick tips to help make your CSS coding as pain-free as possible.
1. Keep it Simple
This may sound obvious but if you find yourself using complicated coding to achieve your design then you should think again about whether the feature you need is really necessary or if you're just thinking about your design and not your visitors. Too often designers get caught up in their own design and go to great lengths to produce a certain visual effect only to find later on that visitors find it either irritating or unusable.
Complex code is usually the result of muddled thinking. Plan your layout logically and work from the outside in and from the top down where possible. Look at what containers you will need and break jobs down into smaller parcels. I usually start with a page wrapper and then progress logically through the header, navigation, main content and footers etc trying to preserve the flow of the document as much as possible.
While good visual design is necessary to attract visitors you must still have good content and a usable and accessible site. If you find your html and css looks like spaghetti then have a re-think and see if you can simplify it. This will make it easier to maintain in the future and will often save code and bandwidth.
2. Don't use hacks unless its a known and documented bug
This is an important point as I too often see hacks employed to fix things that aren't really broken in the first place. If you find that you are looking for a hack to fix a certain issue in your design then first do some research (Google is your friend here) and try to identify the issue you are having problems with.
If you find its a known bug then 99% of the time there will be a known solution to this bug and you can safely use a hack if required knowing that you are fixing a bug and not just correcting bad coding.
I couldn't count the number of times I've seen layouts using hacks when all that was needed was to control the default margins on the page (see next tip).
3. Take care of margins and padding on all elements that you use
All browsers apply default padding and margins to most elements and the amount they apply varies quite substantially. Therefore you need to explicitly control the padding and margins on all the elements you use.
This is covered in depth in this article "No Margin For Error".
4. Avoid using too much absolute positioning
Most novices to CSS quickly latch on to absolute positioning because it is pretty straight-forward and does what it says on the box. However absolute layouts have a number of problems and the biggest problem of all is that absolute elements are removed from the flow.
This means that when you absolutely place an element then it has total disregard to whatever else is on your page. It will overlap whatever was in that position and will take no notice of other content at all. The result of too much absolute positioning is that you end up having to control everything with absolute positioning and makes for a very rigid and inflexible layout.
Local search is a valuable resource for any business looking to build a bigger client pool. Is your business located in the major local search listings? I recently ran across this great 8 part list that may help improve your local search traffic and improving your overall business.
A Rich Experience Massage Therapy and Spa needed a new website design as well and an entire identity package for their new facility. OSEKmedia responded to their need with an entire campaign including web design, print collateral development and a full signage package.