Home / Websites / Rules to Better Websites - Layout And Formatting

Rules to Better Websites - Layout And Formatting

Hold on a second! How would you like to view this content?
Just the title! A brief blurb! Gimme everything!
  1. Do you avoid having Reset buttons on webforms?

    Why do web pages have Reset buttons? I have been entering forms on the web for more years than I care to remember, but have never needed to click this button. The worst thing is I have accidentally hit it a few times after - I have a habit of doing 3 things at once - it happens just after I have finished entering everything and click the first button.
    Figure: The Reset button isn't useful at all

    We have a program called SSW Code Auditor to check for this rule.

    We have a program called SSW Link Auditor to check for this rule.
    We offer a rule sample page for demo scan.

  2. How to use SSW style in RadHtmlControl?

    Do you know how to apply style to image, figure..etc?

    Let's take the "AvoidReplyToAllWhenBcc" page as example.

    First, the reason to cause the style issue is the style doesn’t apply to right place. Below is the html code after you adjust the figure manually (sorry, still not right ). Please look at the highlight part, 
    • the “ms-rteCustom-ImageArea” style doesn’t apply to <img> tag, but wrapped by <span> with “ms-rteCustom-ImageArea” style;  
    • there is no style apply to figure;

    <span class="ms-rteCustom-YellowBorderBox">We have a program called <a href="http://rules.ssw.com.au/WebSites/RulesToBetterWebsitesLayout">
            SSW LookOut! for Outlook</a> to check for this rule.
            <br />
            <br />
           <span class="ms-rteCustom-ImageArea">
                <img style="border-bottom: 0px solid; border-left: 0px solid; border-top: 0px solid;
                    border-right: 0px solid;" border="0" alt="Lookout Reply All BCC Warning" src="http://rules.ssw.com.au/WebSites/RulesToBetterWebsitesLayout" />
                <br />
           </span><b>
                <br />
                Figure: SSW LookOut! for Outlook warns you if you accidentally 'Reply All' when
                you have been BCC'ed  </b> </span>

    1.  Not sure how user inputs the  content into this page. Anyway, here is the right way to add content via Telerik Editor. Please read below example of how I redo this part in Telerik Editor without changing the code manually
    Copy content in notepad
    Figure:Copy content in the notepad2. Delete the current content from Telerik for a new start;

    3. Copy the first sentence from notepad and paste into Telerik Editor in the page; (please avoid copying straightly from web page and pasting them here, it will copy the all tags as well. it might affect the styles which can’t apply correctly )
    Start copying content over
    Figure: Start copying content over4. Insert the image
    Insert an image
    Figure: Add a link to text5. Add an image
    Insert an image
    Figure: Inser an image6. Press “enter” key to start a new row, then copy the figure from notepad to the Telerik editor area
    Add figure
    Figure: Add figure7. Apply image style to the image by click on the image, then choose a style from “Apply CSS Class” dropdown list
    Apply style to the image
    Figure: Apply style to the image

    8. Apply style to the figure
    Apply style to the image
    Figure: Apply style to the figure9.Apply the yellow box
    Apply style to the figure
    Figure: Apply yellow border box to the content10. Check in the changes, then you will have - "dada.."
    Right stlye in use
    Figure: Right style in use

  3. Do you add images to reduce the words (and use the DL tag)?

    An image is worth a thousand words, that's true. Remember that and use an image instead of text to describe something.

    Use the <dl class="className"></dl> tag to include an image in your page.

    You then have this pretty pink flower with a green stem standing on a water pond. It is beautiful.

    Figure: Bad Example
    Figure: Good example - Add a picture or a screen capture to avoid a thousand words

    Technical note for the figure (aka Caption)

    Most developers (even WordPress) put the image and the caption in a DIV tag. The figure is just a paragraph.

    <div>
    <img alt=""/>
    <p>Figure: Caption</p>
    </div>
    
    Figure: Bad Example

    Instead, use a figure under the image, using a DL. A DL is a HTML tag that stands for ‘Definition List’. It contains a DT which is the item in the list – in our case an image. A DD (the description of the item). This structure gives the image and the figure, semantic meaning.

    <dl>
    <dt><img alt=""/></dt>
    <dd>Figure: Caption</dd>
    </dl>
    
    Figure: Good Example
  4. Do you make sure that all your tags are well formed ?

    Do you know how to form HTML/XML tags on webpages?
    We need to make sure that all HTML/XML tags which open once, must be closed properly.

    <div>
    <p>Hello HTML</p>
    </div>
    Figure: Good Example

    <breakfast_menu>
    <food>
    <name>Homestyle Breakfast</name>
    <price>$6.95</price>
    <description>two eggs</description>
    <calories>950</calories>
    </food>
    </breakfast_menu>
    Figure: Good Example
    <div>
    <p>Hello HTML  
    </div>
    Figure: Bad Example
    <breakfast_menu>
    <food>
    <name>Homestyle Breakfast
    <price>$6.95
    <description>two eggs
    <calories>950
    </food>
    </breakfast_menu>
    Figure: Bad Example
  5. HTML/CSS - Do you know how to create spaces in a web page?

    There are many scenarios where you need some extra space in a web page. No matter which one you are at, CSS is the answer.

    Sometimes the first thing that comes to the developer mind is to use the "break line" tag (<br />) or the ASCII character code for "space" (&#160;) to create these extra spaces. It's wrong. CSS is the way to go. You can use both "margin" or "padding" CSS properties to get the result you want.

    <ul>
    <li>&#160;&#160;&#160;List item</li>
    </ul>
    Figure: Bad Example - Using the "space" ASCII character to create a padding on that list
    <ul>
    <li>List item</li>
    </ul>
    <br />
    <br />
    <br />
    Figure: Bad Example - Using the <br /> tag to create a space at the bottom of that list
    ul {margin-bottom:15px;}
    ul li {padding-left:10px;}
    Figure: Good Example - Using CSS to add a margin at the bottom of the list a the padding on the left side of each list item

    Tip: You might be not familiar with editing a CSS file. In this case, contact a designer. He/She will be more than happy to help you.

  6. Do you know how to use named anchor links?

    The attribute "name" allows you to link to specific places within the page, via the <a> tag.

    This is especially useful in long pages that can be separated into sections. You can create a named anchor in each of these section headings to provide "jump-to" functionality. In other words, you can have a different URL for each piece of content on the same page.

    <h2><a name="get-started"></a>Get Started</h2> Figure: This is how you add an anchor name to an specific section of your page. Note it doesn't have the hash mark and the anchor tag is empty

    You now have a custom URL that points to the specific section of the page. It is the page URL followed by the hash mark and the name you chose:

    http://www.yourpage.com#get-started Figure: This is how your custom URL will look like

    You can use this new URL to point users to that specific section of your page.

    To create a link to your anchor named section inside the same page, simply add a new "href" anchor tag - now with a hash mark followed by the name you chose:

    <a href="#get-started">Go to Get Started section</a> Figure: This is how you add a *link* to that anchor name you created inside the same page. Remember to add the hash mark

    Tip #1: Use the hash mark only to go to the top of a page. 
    E.g. <a href="#">&Go to top</a>

    Tip #2: Some browsers consider capitalization for anchor names (E.g. Firefox). Always check your links and anchor names are identical, matching the capitalization.

  7. Do you know FONT tags are no longer used?

    The <font> tag is supported in all major browsers, however it is deprecated since HTML 4. Read more at w3schools.com.

    <font>Some text</font>
    Figure: Bad Example - Using deprecated HTML tag
    <span>Some text</span>
    <p>Some text</p>
    Figure: Good Example - Using <p> or <span> for texts

    Tip: Use CSS to define the font, size, and color of text.

    We have the programs SSW Code Auditor and SSW Link Auditor to check for this rule.

  8. Do you use spelling and grammar checker to make your web content professional?

    Spelling errors give a bad impression, whether you are reading a website or an email. Some common spelling errors are very easy to avoid. Use Microsoft Word Spelling & Grammar Checker to prevent future mistakes.

    These are some examples of common spelling mistakes that you can fix:

    • thankyou -> thank you
    • recieve -> receive
    • paremeter -> parameter
    • definate -> definite
    • seperate -> separate