![]() |
| Forums | Gallery | Movies | File Hosting | Classifieds | Jokes | Free Hosting | Free Blogs |
|
||||
|
1.
#nav a {color:red;text-decoration:none} PLAIN TEXT HTML: 1. <ul id="nav"> 2. <li><a href="#">Link1</a></li> 3. <li><a href="#">Link2</a></li> 4. <li><a href="#">Link3</a></li> 5. <li><a href="#">Link4</a></li> 6. <li><a href="#">Link5</a></li> 7. <li><a href="#">Link6</a></li> 8. </ul> As you can see we get the same effect and save considerably on mark-up and readability. A lot of times the ul may be unique in a section anyway and you can use the parent id without even having to add an id to the ul. (Remember that id's are unique and can only be used once per page.) 7. Validate your code Visit the validator at every opportunity and validate your css and html especially when learning something new. If you are new to html/css then validate regularly during development so that you can be sure the code you are using is correct; that will allow you to concentrate on getting the design right. Do not wait until you have finished coding the design as you may be using features that are not appropriate and will result in a lot more work than necessary. Validating frequently will also catch simple errors like typos which will always creep into the code when you are not looking. 8. Rationalize your code At every stage during development ask yourself whether you need that extra div wrapper or not. Can existing elements be utilised for background images without adding extraneous code? Thinking ahead and planning your layout beforehand will often lead to more concise code and an easier-to-manage layout. 9. Flexibility Remember that a web page isn't the same as a printed page and that ultimately the user has more control over how your page will appear than you do. With this in mind try to allow for some flexibility in your design so that things like text resizing issues don't break your layout. Don't make everything a fixed height/width or at least use ems to allow the layout to expand when text is resized. With a little thought and patience you can still make your page look good and satisfy accessibility requirements. 10. Browser support A designer's lot is often not a happy one due to the variance in the display offered via various browsers. There is no easy answer to this question (apart from the tips already given) and my method of working is as follows. First of all decide with your client (or yourself) what browsers you are aiming to support. This will of course be based on many factors (which we won't go into here) but could be as simple as checking your server stats to see who your visitors are. Once you have decided what browsers to support then make sure that you have access to these browsers in some way. The easiest way is to download the browser you need so you can test locally. If you can't download the browsers for one reason or another or you need to test on another platform, then there are a number of sites that will offer remote access or screenshots. Some of these require payment and some of the simpler ones are free (a quick look on Google will soon sort you out). Once you have decided what browsers to support it is time to start coding then you must check your design at every stage in the browsers that you want to support. This means writing a line of code then firing up at least 3 or 4 browsers to check. As you get more experienced you will soon learn what is likely to work and what doesn't and you can check less frequently. If you take this approach of checking at every stage then you will soon find out what works and what doesn't and identify problems straight away and determine the cause is immediately. This would not be the case if you waited until you had finished and then checked the design. It could take hours (or days) to identify where the problem is and what is causing it. It may in fact be too late to fix it because you have built the whole page on a function that only works in one browser and you would have to start again from scratch. By checking as you go you eliminate this problem and quite often a small change in design at each stage will accommodate nearly all the browsers you need to support without needing to hack. You can't make these small tweaks and changes in design if you wait until the end. The above tips for css coding aren't in any special order and most are just plain common sense. If you follow the advice given you will make your web design life a lot easier and less stressful. thank you |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|