Design for Usability
When designing how your web page will work you need to consider those visitors without JavaScript, those with old non-standard versions of JavaScript as well as those with standard compliant versions. You also need to respect the right of your visitors to have their browser work the way that they expect it to.
The most important part of a web page and the part that your visitors are actually visiting to see is the content.
The first stem therefore in creating a web page is to create your content. To ensure that it can be processed in an acceptable way by all of your visitors regardless of how they are accessing that content and regardless of whether the stylesheet and JavaScript gets applied you should use appropriate semantic markup in your HTML. This means using the appropriate HTML tags around your content that define what that content is. If it is a heading then it should be enclosed within one of the six heading tags. Paragraphs should be within paragraph tags, lists within the appropriate list tags and so on. You can then add id and class attributes to these tags as required to provide the hooks needed to attach your stylesheet and JavaScript that you want to have applied to those sections of the page.
There will be occasions where an appropriate semantic tag does not exist such as when you want to separate out a short section of text for separate processing or group together several elements that will need to be kept together.
Adding <span> and <div> tags with an appropriate id or class will handle these situations.
The main thing to avoid in creating your HTML is the use of inappropriate tags. The only time you need to use a table tag is when you are inserting tabular data into your page and the only time you should use a div tag is where you want to group several elements within the page together and an appropriate tag for identifying what that group is does not exist.
Writing your HTML this way will both make your web page more user friendly to all visitors regardless of what their browser does or doesn't support and will also make it much easier to attach our JavaScript into the web page in a way that will allow the page to work regardless of whether or not the JavaScript gets run.
Once your HTML is written you can then define how you want it to look for different media by defining appropriate stylesheets for each media. The easiest way to do this is to start at the top left corner of the page and position each part of the page in turn by defining its margins, padding, width and overflow attributes as well as float and/or clear to determine its alignment relative to the rest of the page. If we want things to overlap then we will also need to use both relative and absolute positioning and if we intend to move something around the page using JavaScript we will need to use absolute positioning. Coding our stylesheet in this way will also make it much easier for us to be able to use JavaScript to change the appearance of the web page.
Your web page should be thoroughly tested in several different browsers before you add the JavaScript to it in order to make sure that the page displays correctly for those visitors who don't have JavaScript enabled. By testing the page at this point we avoid the need to turn JavaScript off in our browser since there is no JavaScript in the page to be disabled.
The final step in designing a useable web page is to create the JavaScript for the page. This should be there to enhance the way that the page works for those with JavaScript enabled such as by performing tasks that reduce the need for reloading web pages from the server.
The most important part of a web page and the part that your visitors are actually visiting to see is the content.
The first stem therefore in creating a web page is to create your content. To ensure that it can be processed in an acceptable way by all of your visitors regardless of how they are accessing that content and regardless of whether the stylesheet and JavaScript gets applied you should use appropriate semantic markup in your HTML. This means using the appropriate HTML tags around your content that define what that content is. If it is a heading then it should be enclosed within one of the six heading tags. Paragraphs should be within paragraph tags, lists within the appropriate list tags and so on. You can then add id and class attributes to these tags as required to provide the hooks needed to attach your stylesheet and JavaScript that you want to have applied to those sections of the page.
There will be occasions where an appropriate semantic tag does not exist such as when you want to separate out a short section of text for separate processing or group together several elements that will need to be kept together.
Adding <span> and <div> tags with an appropriate id or class will handle these situations.
The main thing to avoid in creating your HTML is the use of inappropriate tags. The only time you need to use a table tag is when you are inserting tabular data into your page and the only time you should use a div tag is where you want to group several elements within the page together and an appropriate tag for identifying what that group is does not exist.
Writing your HTML this way will both make your web page more user friendly to all visitors regardless of what their browser does or doesn't support and will also make it much easier to attach our JavaScript into the web page in a way that will allow the page to work regardless of whether or not the JavaScript gets run.
Once your HTML is written you can then define how you want it to look for different media by defining appropriate stylesheets for each media. The easiest way to do this is to start at the top left corner of the page and position each part of the page in turn by defining its margins, padding, width and overflow attributes as well as float and/or clear to determine its alignment relative to the rest of the page. If we want things to overlap then we will also need to use both relative and absolute positioning and if we intend to move something around the page using JavaScript we will need to use absolute positioning. Coding our stylesheet in this way will also make it much easier for us to be able to use JavaScript to change the appearance of the web page.
Your web page should be thoroughly tested in several different browsers before you add the JavaScript to it in order to make sure that the page displays correctly for those visitors who don't have JavaScript enabled. By testing the page at this point we avoid the need to turn JavaScript off in our browser since there is no JavaScript in the page to be disabled.
The final step in designing a useable web page is to create the JavaScript for the page. This should be there to enhance the way that the page works for those with JavaScript enabled such as by performing tasks that reduce the need for reloading web pages from the server.
Source...