Activity Stream
48,167 MEMBERS
6942 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 9 of 9
  1.     
    #1
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com

    Default 10 Common HTML Mistakes to Avoid

    10 Common HTML Mistakes to Avoid

    1. Don?t place Block elements within Inline elements

    An HTML element is displayed as Block or as Inline by default. Block elements, such as divs and paragraphs, make up the structure of the document. Inline elements reside in these blocks, such as anchor and span tags. So you should never put blocks inside inline elements.

    Wrong:
    <a href="#"><h2>Block inside Inline</h2></a>

    Right:
    <h2><a href="#">Inline inside Block</a></h2>

    2. Always have the alt attribute for image tags

    The ALT attribute is a required one for IMG tags, it describes the context of the image. It helps your user on a screen reader or with a slow connection to decide whether or not the image is important. It also makes the web crawler index your contents better. If the images is just for show, use an empty ALT attribute like alt=?"

    Wrong:
    <img src="profilepic.jpeg"/>

    Right:
    <img src="profilepic.jpeg" alt="Profile pic of the user"/>

    3. Don?t use line breaks to show a list

    If you wan?t to show a list of things in bulleted or numbered order, never use line breaks. Use unordered list <ul> or ordered list <ol> tags for this purpose.

    Wrong:
    1. Steve Jobs<br/>
    2. Bill Gates<br/>
    3. Linus Torvalds

    Right:
    <ol>
    <li>Steve Jobs</li>
    <li>Bill Gates</li>
    <li>Linus Torvalds</li>
    </ol>

    4. Don?t use <b> and <i> for bolding and italicizing

    <b> and <i> are used for bolding and italicizing texts. However semantically they are classified as presentational tags. You should rather use the CSS properties font-weight and font-style for these purposes respectively. If practicality dictates to apply the styles on the document, use <strong> and <em> instead. They do the same job as <b> and <i> but are semantically correct.

    Wrong:
    <b>This is bold but wrong!</b>

    Right:
    <strong>This is bold and right!</strong>

    5. Don?t use multiple line breaks

    The line break tag of <br /> should only be used to insert is single line breaks in the flow of paragraph text to knock a particularly word down onto a new line. It shouldn?t be used to make gaps between elements, instead, split the text into separate paragraphs, or adjust the margin styled by CSS.

    Wrong:
    This is a line
    <br/>
    <br/>
    This is another line.

    Right:
    <p>This is a line</p>
    <p>This is another line</p>

    6. Avoid Inline Styles

    You have probably heard this a lot of times before. The whole point of semantic HTML and CSS is to separate document structure and styling, so it just doesn?t make sense to place styling directly in the HTML document.

    Wrong:
    <h2 style="color:red;">Wrong</h2>

    Right:
    HTML =>
    <h2>Right</h2>
    CSS =>
    h2 .red{color: red;}

    7. Don?t add(or remove) the border attribute in HTML

    Border attribute is also presentational and should be semantically left to be modified in the CSS rather than in the HTML document.

    Wrong:
    <img src="mypic.png" alt="" border="0"/>

    Right:
    HTML =>
    <img src="mypic.jpg" alt=""/>
    CSS =>
    img .no-border{border: 0px;}

    8. Never use <blink> or <marquee>

    These tags have never been included in the official HTML standard of W3C consortium. Apart from that, their use is considered as ugly and unimpressive. If you need to draw attention to a certain part of your document, use an alternative approach in a less offensive manner.

    Wrong:
    <marquee>Look at me!</marquee>

    Right:
    Just don?t use it.

    9. Avoid using deprecated elements

    There are some old HTML tags and attributes which have been declared deprecated by W3C consortium. Although modern browsers currently support them, they might not in future. Check out this article that lists almost all of the deprecated elements.

    10. Don?t forget to put the DOCTYPE

    The Doctype describes what kind of HTML you are using. If it?s not there, you don?t know if your code is valid. Plus your browser makes assumptions for you, and it might not workout the way you planned. Its often left off because nobody can remember the long address. You can use a blank document template, so you don?t have to remember it, but it?ll always be available.

    Credits: Krypto
    l0calh0st Reviewed by l0calh0st on . 10 Common HTML Mistakes to Avoid 10 Common HTML Mistakes to Avoid 1. Don?t place Block elements within Inline elements An HTML element is displayed as Block or as Inline by default. Block elements, such as divs and paragraphs, make up the structure of the document. Inline elements reside in these blocks, such as anchor and span tags. So you should never put blocks inside inline elements. Wrong: <a href="#"><h2>Block inside Inline</h2></a> Right: Rating: 5

    Defendos BETA3 Released! Thread - Official Website

  2.   Sponsored Links

  3.     
    #2
    Member
    lol, nice find - or did you write it o.o assuming your not Krypto

    found this rather interesting

  4.     
    #3
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com
    Found

    Defendos BETA3 Released! Thread - Official Website

  5.     
    #4
    Member
    lmao i loved this bit so true


    Wrong:
    <marquee>Look at me!</marquee>

    Right:
    Just don’t use it.
    Signature too big, removed by staff.

  6.     
    #5
    Banned
    its nice

  7.     
    #6
    Member
    Thank you

  8.     
    #7
    Banned
    Quote Originally Posted by shadow.prx View Post
    lmao i loved this bit so true


    Wrong:
    <marquee>Look at me!</marquee>

    Right:
    Just don’t use it.
    lol all the points are right but not this one man
    even if its not a standard, who cares
    we will have to add shitload of crap js to achieve BLINK

  9.     
    #8
    Probation
    nice tips

  10.     
    #9
    Banned
    Website's:
    freakyworld.net
    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. 4 Deadly Seo Mistakes You Must Avoid
    By ::superman:: in forum Whitehat SEO
    Replies: 10
    Last Post: 25th May 2012, 04:28 PM
  2. 7 SEO Mistakes to Avoid!
    By XForce! in forum Tutorials and Guides
    Replies: 4
    Last Post: 15th Jan 2011, 05:35 AM
  3. 5 SEO Mistakes you Can Avoid
    By Faizann20 in forum Tutorials and Guides
    Replies: 2
    Last Post: 13th Jan 2011, 07:29 PM

Tags for this Thread

BE SOCIAL