SlideShare a Scribd company logo
HTML@eCommera
Best practices & fun stuff
about:this.presentation
• Jordan Dichev – webdev @ eCommera
• Presentation about HTML best practices
• New & interesting features
Why is front-end (HTML, JS, CSS)
important?
• Well written front-end code has strongest
impact on user experience on web sites.
• It is often disregarded by developers in
detriment to site performance and therefore
company image.
• Considered a web development skill by default
but takes time to learn and master.
General guidelines
• Apply consistency everywhere
– It’s more important for HTML, CSS, and JS to be
consistently written than the exact style in which
they are written.
– Mixing styles and frameworks can (and will) cause
issues

• Design before implementing
– Plan before writing code from scratch such as in
new projects and new-feature implementations
How it’s made

HTML DOCUMENT ANATOMY
Always specify DOCTYPE and XML
namespace.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ">
<html xmlns="http://www.w3.org/1999/xhtml">
</html>
Specify lang attributes in html element
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
</html>
Always put a title tag in head
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
<head>
<title>title text here</title>
</head>
</html>
Always put all style and JavaScript
declarations in head section
• This provides for progressive rendering of web pages – CSS
files come first, before JS code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>title text here</title>
<style rel="stylesheet" type="text/css"
href="/path/to/stylesheets/stylesheet1.css" />
<style rel="stylesheet" type="text/css"
href="/path/to/stylesheets/stylesheet2.css" />
<script type="text/javascript"
src="/path/to/javascripts/javascript1.js"></script>
<script type="text/javascript"
src="/path/to/javascripts/javascript2.js"></script>
</head>
</html>
Provide metadata tags for character
encoding, short description and
keywords
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>title text here</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="Short description text here"/>
<meta name="keywords" content="Keywords, separated by commas, like that, here"/>
<style rel="stylesheet" type="text/css" href="/path/to/stylesheets/stylesheet1.css" />
<style rel="stylesheet" type="text/css" href="/path/to/stylesheets/stylesheet2.css" />
<script type="text/javascript" src="/path/to/javascripts/javascript1.js"></script>
<script type="text/javascript" src="/path/to/javascripts/javascript2.js"></script>
</head>
</html>
Semantic authoring of HTML
documents
• HTML is for describing the structure and
meaning of content – not for describing
presentation
• Semantics of HTML 4.01 and XHTML 1.0 are
identical, the syntax is different
• HTML doesn't have an element for everything
Elements display
• Block
Takes up the full width available, with a new
line before and after (display:block)
• Inline
Takes up only as much width as it needs, and
does not force new lines (display:inline)
• Not displayed
Some tags, like <meta /> and <style> are not
visible (display:none)
Common HTML elements that are
naturally block-display include
•
•
•
•
•
•
•
•
•

<div>
Your general-purpose box
<h1> … <h6>
All headings
<p>
Paragraph
<ul>, <ol>, <dl>
Lists (unordered, ordered and definition)
<li>, <dt>, <dd>
List items, definition list terms, and definition list definitions
<table>
Tables
<blockquote>
Like an indented paragraph, meant for quoting passages of text
<pre>
Indicates a block of preformatted code
<form>
An input form
Naturally inline elements
•
•
•
•
•
•
•
•
•

<span>
Your all-purpose inline element
<a>
Anchor, used for links (and also to mark specific targets on a page for direct linking)
<strong>
Used to make your content strong, displayed as bold in most browsers, replaces the narrower <b>
(bold) tag
<em>
Adds emphasis, but less strong than <strong>. Usually displayed as italic text, and replaces the old
<i> (italic) tag
<img />
Image
<br>
The line-break is an odd case, as it’s an inline element that forces a new line. However, as the text
carries on on the next line, it’s not a block-level element.
<input>
Form input fields like and
<abbr>
Indicates an abbr
<acronym>
Working much like the abbreviation.
Semantics of elements
• Use the element whose meaning is closest to the presented
information's meaning.
• <title> should be used always as it identifies document
contents and is used by browsers, search engines, other
apps, etc.
• <h1> to <h6> should be used for identifying document's
structural parts and hierarchy
• <ul>, <ol> for lists and navigation
• <label> should be used in forms to identify form elements
• <p> for texts
• <blockquote>, <q>, <cite> and cite attribute
• <link> in <head> for relationships with other documents
Attributes
• Use meaningful id and class attribute names they should be self-descriptive
• ids - where only one element exists
• classes - for multiple elements
Some more info and tips about accessibility and usability features of
HTML

ACCESSIBILITY AND USABILITY TIPS
Tables
• table - summary attribute - provides a non-visual
summary of the table’s content or purpose, which
may be useful to people accessing the table using
assistive technology
• th/td - scope attribute - specifies the direction of
the table cells that the header cell relates to
• th/td - headers attribute - indicates which table
headers are related to a given table data cell,
providing context for the data for users of nonvisual browsers
Forms
• fieldset and legend elements - logically group
related form controls, and provide a title for
the grouping via the legend element
• label element - links a form control to the
associated descriptive text in a totally
unambiguous way---a great aid for users of
non-visual browsers, such as those using
screen readers to interact with forms
Images
• alt attribute - provides a text alternative for an
important image; can be applied to img
element or to an input of type "image"
• longdesc attribute - provides a link to
additional information, contained in a
separate text file, about the image
Anchors (<a>)
• title attribute - in anchor tags it additionally
specifies text description of element
General Aids
• a well-written document title - opportunity for
explaining what is to follow.
• headings (h1-h6) - headings provide users of such
assistive devices as screen readers with an additional-and quick--method for navigating through a document
by skipping from heading to heading.
• list items (in ul or ol elements) - wrapping navigation
items in a list allows users of assistive technology to
skip entire blocks of navigation easily, jumping from
one navigation level to another.
Checks
Before you complete an HTML tasks, the following checks
need to be carried out to confirm the validity of the
work.
• Confirm page works in Firefox, Internet Explorer, Safari
• Check page for unnecessary objects in the page (use
firebug). If any objects are not used (including JS
rollover images), please comment out before deleting
• Check changes against accessibility tool and
accessibility guidelines
• Confirm page is SEO friendly and relevant SEO
guidelines have been followed
DOs and DONTs

COMMON HTML MISTAKES TO
AVOID
Forgetting to Close a Tag
• This is very common. Several tags require
closing tags such as divs, strong tags, and links
to name a few. Other tags require a closing
slash to end the line such as an img tag.
<div>Text inside the div.</div>
<img src="images/imagename.jpg" />
Incorrect DOCTYPE
• HTML requires that you start out the
document with the correct DOCTYPE
declaration. It needs to be before anything
else in the code, starting the document by
declaring what type of HTML you’re using.
Here’s the DOCTYPE for XHTML 1.0
Transitional.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ">
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
Improperly nesting tags
• It’s very important to open and close tags in
the proper order. Once something (for
example a div) has opened, it must close
before anything above it can close. The
following is incorrect.
<div><strong>text</div></strong>
Capitalizing tags
• This is just considered bad practice, but won’t
result in your code not being validated. You
should always use lowercase for tags like divs,
links, and images. The following is incorrect.
<DIV></DIV>
Forgetting to open or close quotes
• It will result in broken code and things not
functioning properly. HTML requires double
quotes that open and close correctly. Here’s
an example of correct usage.
<img src="images/headerimage.jpg" />
Using inline styles
• This is another one that is considered bad
practice. Inline styles do work but will result in
headaches later on! Items should be styled
globally through an external stylesheet. It will
be much easier to edit and add styles to in the
future. An example of inline styles:
<a href="link.html" style="color: #000; text-decoration:
none;">link name</a>
Not Encoding Special Characters
• Characters like “©” and “&” should be shown
with the proper HTML code for the character.
Confusing Classes and IDs
• Classes are for items that are used more than
once on one page. This can be a link style that
you’ll call in multiple times on one page but
doesn’t follow the global link styling.
• IDs are items that are called in just once, like the
header div.
• Classes and ids are often overused and used in
unnecessary places as well. Stick to the minimum
amount of classifications that you need.
Not Using Unique Names for IDs
• It’s very important to choose names that are
unique so that it’s easy to edit later on, and
easy to identify in your stylesheet. Name your
divs specific things like #home-left-column
which is better than just #left.

More Related Content

PPTX
Xhtml and html5 basics
PDF
HTML CSS Best Practices
PPTX
Cascading style sheets
PPTX
Dom date and objects and event handling
PPTX
Unit iv xml dom
KEY
HTML/CSS Lecture 1
PPT
PPTX
Css presentation lecture 1
Xhtml and html5 basics
HTML CSS Best Practices
Cascading style sheets
Dom date and objects and event handling
Unit iv xml dom
HTML/CSS Lecture 1
Css presentation lecture 1

What's hot (20)

PPTX
Html (1)
PDF
Intro to HTML, CSS & JS - Internship Presentation Week-3
PDF
Intro to HTML and CSS - Class 2 Slides
PDF
HTML5: the new frontier of the web
PPT
HTML & CSS Workshop Notes
PPTX
Castro Chapter 3
PPTX
Html css java script basics All about you need
PPTX
Building Your First Store App with XAML and C#
PDF
HTML Lecture Part 1 of 2
PPTX
Web Development Using CSS3
PDF
Web Development Using CSS3
PPTX
HTML, CSS and Java Scripts Basics
PDF
Modern development paradigms
PDF
Html,javascript & css
PPTX
4. html css-java script-basics
PPTX
HTML (Basic to Advance)
PDF
Introduction to WEB HTML, CSS
PDF
Intro to HTML & CSS
Html (1)
Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML and CSS - Class 2 Slides
HTML5: the new frontier of the web
HTML & CSS Workshop Notes
Castro Chapter 3
Html css java script basics All about you need
Building Your First Store App with XAML and C#
HTML Lecture Part 1 of 2
Web Development Using CSS3
Web Development Using CSS3
HTML, CSS and Java Scripts Basics
Modern development paradigms
Html,javascript & css
4. html css-java script-basics
HTML (Basic to Advance)
Introduction to WEB HTML, CSS
Intro to HTML & CSS
Ad

Viewers also liked (13)

PPSX
GROW presentation
PPTX
Coffee script
PDF
The Statistical Significance of &quot;R&quot;
PPT
Movel Project Presentation - W3C Workshop - English Version
PDF
Warthog Photography - Models, Bands/Music, Original Portraiture.
PPT
ADHD
PDF
Ggplot2
PPT
BHAG 2: Change
PPT
Cidadania Movel Project - e-GOIA implementation case Alagoas Demonstrator
PPTX
13 anos de gerenciamento de projetos na administração pública estadual
PPT
Meie Unistuste Kool
PPT
SRV Servicios de Marketing
PDF
Brochure sumatoria final
GROW presentation
Coffee script
The Statistical Significance of &quot;R&quot;
Movel Project Presentation - W3C Workshop - English Version
Warthog Photography - Models, Bands/Music, Original Portraiture.
ADHD
Ggplot2
BHAG 2: Change
Cidadania Movel Project - e-GOIA implementation case Alagoas Demonstrator
13 anos de gerenciamento de projetos na administração pública estadual
Meie Unistuste Kool
SRV Servicios de Marketing
Brochure sumatoria final
Ad

Similar to Html presentation (20)

PPT
HTML course.ppt
PDF
HTML_Training_101
PPTX
1-22-24 INFO 2106.pptx
PPTX
website design mark-up with HTML 5 .pptx
PPTX
HTML by Telerik Akademy
PPT
Introduction to HTML
PDF
Code & Design your first website 4/18
PPT
Unit 2 (html)
PPTX
1-24-24 INFO 3205.pptx
PPTX
HTMLforbeginerslearntocodeforbeginersinfh
PDF
Sperimentazioni di Tecnologie e Comunicazioni Multimediali: Lezione 3
PDF
Code &amp; design your first website (3:16)
PPTX
Introduction to HTML+CSS+Javascript.pptx
PPTX
Introduction to HTML+CSS+Javascript.pptx
PPTX
Introduction to HTML+CSS+Javascript.pptx
PPTX
Web technologies: Lesson 2
PPTX
Lab1_HTML.pptx
PPTX
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
HTML course.ppt
HTML_Training_101
1-22-24 INFO 2106.pptx
website design mark-up with HTML 5 .pptx
HTML by Telerik Akademy
Introduction to HTML
Code & Design your first website 4/18
Unit 2 (html)
1-24-24 INFO 3205.pptx
HTMLforbeginerslearntocodeforbeginersinfh
Sperimentazioni di Tecnologie e Comunicazioni Multimediali: Lezione 3
Code &amp; design your first website (3:16)
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
Web technologies: Lesson 2
Lab1_HTML.pptx
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Empathic Computing: Creating Shared Understanding
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Reach Out and Touch Someone: Haptics and Empathic Computing
Empathic Computing: Creating Shared Understanding
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Per capita expenditure prediction using model stacking based on satellite ima...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The AUB Centre for AI in Media Proposal.docx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...

Html presentation

  • 2. about:this.presentation • Jordan Dichev – webdev @ eCommera • Presentation about HTML best practices • New & interesting features
  • 3. Why is front-end (HTML, JS, CSS) important? • Well written front-end code has strongest impact on user experience on web sites. • It is often disregarded by developers in detriment to site performance and therefore company image. • Considered a web development skill by default but takes time to learn and master.
  • 4. General guidelines • Apply consistency everywhere – It’s more important for HTML, CSS, and JS to be consistently written than the exact style in which they are written. – Mixing styles and frameworks can (and will) cause issues • Design before implementing – Plan before writing code from scratch such as in new projects and new-feature implementations
  • 5. How it’s made HTML DOCUMENT ANATOMY
  • 6. Always specify DOCTYPE and XML namespace. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "> <html xmlns="http://www.w3.org/1999/xhtml"> </html>
  • 7. Specify lang attributes in html element <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> </html>
  • 8. Always put a title tag in head <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>title text here</title> </head> </html>
  • 9. Always put all style and JavaScript declarations in head section • This provides for progressive rendering of web pages – CSS files come first, before JS code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>title text here</title> <style rel="stylesheet" type="text/css" href="/path/to/stylesheets/stylesheet1.css" /> <style rel="stylesheet" type="text/css" href="/path/to/stylesheets/stylesheet2.css" /> <script type="text/javascript" src="/path/to/javascripts/javascript1.js"></script> <script type="text/javascript" src="/path/to/javascripts/javascript2.js"></script> </head> </html>
  • 10. Provide metadata tags for character encoding, short description and keywords <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>title text here</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="Short description text here"/> <meta name="keywords" content="Keywords, separated by commas, like that, here"/> <style rel="stylesheet" type="text/css" href="/path/to/stylesheets/stylesheet1.css" /> <style rel="stylesheet" type="text/css" href="/path/to/stylesheets/stylesheet2.css" /> <script type="text/javascript" src="/path/to/javascripts/javascript1.js"></script> <script type="text/javascript" src="/path/to/javascripts/javascript2.js"></script> </head> </html>
  • 11. Semantic authoring of HTML documents • HTML is for describing the structure and meaning of content – not for describing presentation • Semantics of HTML 4.01 and XHTML 1.0 are identical, the syntax is different • HTML doesn't have an element for everything
  • 12. Elements display • Block Takes up the full width available, with a new line before and after (display:block) • Inline Takes up only as much width as it needs, and does not force new lines (display:inline) • Not displayed Some tags, like <meta /> and <style> are not visible (display:none)
  • 13. Common HTML elements that are naturally block-display include • • • • • • • • • <div> Your general-purpose box <h1> … <h6> All headings <p> Paragraph <ul>, <ol>, <dl> Lists (unordered, ordered and definition) <li>, <dt>, <dd> List items, definition list terms, and definition list definitions <table> Tables <blockquote> Like an indented paragraph, meant for quoting passages of text <pre> Indicates a block of preformatted code <form> An input form
  • 14. Naturally inline elements • • • • • • • • • <span> Your all-purpose inline element <a> Anchor, used for links (and also to mark specific targets on a page for direct linking) <strong> Used to make your content strong, displayed as bold in most browsers, replaces the narrower <b> (bold) tag <em> Adds emphasis, but less strong than <strong>. Usually displayed as italic text, and replaces the old <i> (italic) tag <img /> Image <br> The line-break is an odd case, as it’s an inline element that forces a new line. However, as the text carries on on the next line, it’s not a block-level element. <input> Form input fields like and <abbr> Indicates an abbr <acronym> Working much like the abbreviation.
  • 15. Semantics of elements • Use the element whose meaning is closest to the presented information's meaning. • <title> should be used always as it identifies document contents and is used by browsers, search engines, other apps, etc. • <h1> to <h6> should be used for identifying document's structural parts and hierarchy • <ul>, <ol> for lists and navigation • <label> should be used in forms to identify form elements • <p> for texts • <blockquote>, <q>, <cite> and cite attribute • <link> in <head> for relationships with other documents
  • 16. Attributes • Use meaningful id and class attribute names they should be self-descriptive • ids - where only one element exists • classes - for multiple elements
  • 17. Some more info and tips about accessibility and usability features of HTML ACCESSIBILITY AND USABILITY TIPS
  • 18. Tables • table - summary attribute - provides a non-visual summary of the table’s content or purpose, which may be useful to people accessing the table using assistive technology • th/td - scope attribute - specifies the direction of the table cells that the header cell relates to • th/td - headers attribute - indicates which table headers are related to a given table data cell, providing context for the data for users of nonvisual browsers
  • 19. Forms • fieldset and legend elements - logically group related form controls, and provide a title for the grouping via the legend element • label element - links a form control to the associated descriptive text in a totally unambiguous way---a great aid for users of non-visual browsers, such as those using screen readers to interact with forms
  • 20. Images • alt attribute - provides a text alternative for an important image; can be applied to img element or to an input of type "image" • longdesc attribute - provides a link to additional information, contained in a separate text file, about the image
  • 21. Anchors (<a>) • title attribute - in anchor tags it additionally specifies text description of element
  • 22. General Aids • a well-written document title - opportunity for explaining what is to follow. • headings (h1-h6) - headings provide users of such assistive devices as screen readers with an additional-and quick--method for navigating through a document by skipping from heading to heading. • list items (in ul or ol elements) - wrapping navigation items in a list allows users of assistive technology to skip entire blocks of navigation easily, jumping from one navigation level to another.
  • 23. Checks Before you complete an HTML tasks, the following checks need to be carried out to confirm the validity of the work. • Confirm page works in Firefox, Internet Explorer, Safari • Check page for unnecessary objects in the page (use firebug). If any objects are not used (including JS rollover images), please comment out before deleting • Check changes against accessibility tool and accessibility guidelines • Confirm page is SEO friendly and relevant SEO guidelines have been followed
  • 24. DOs and DONTs COMMON HTML MISTAKES TO AVOID
  • 25. Forgetting to Close a Tag • This is very common. Several tags require closing tags such as divs, strong tags, and links to name a few. Other tags require a closing slash to end the line such as an img tag. <div>Text inside the div.</div> <img src="images/imagename.jpg" />
  • 26. Incorrect DOCTYPE • HTML requires that you start out the document with the correct DOCTYPE declaration. It needs to be before anything else in the code, starting the document by declaring what type of HTML you’re using. Here’s the DOCTYPE for XHTML 1.0 Transitional. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  • 27. Improperly nesting tags • It’s very important to open and close tags in the proper order. Once something (for example a div) has opened, it must close before anything above it can close. The following is incorrect. <div><strong>text</div></strong>
  • 28. Capitalizing tags • This is just considered bad practice, but won’t result in your code not being validated. You should always use lowercase for tags like divs, links, and images. The following is incorrect. <DIV></DIV>
  • 29. Forgetting to open or close quotes • It will result in broken code and things not functioning properly. HTML requires double quotes that open and close correctly. Here’s an example of correct usage. <img src="images/headerimage.jpg" />
  • 30. Using inline styles • This is another one that is considered bad practice. Inline styles do work but will result in headaches later on! Items should be styled globally through an external stylesheet. It will be much easier to edit and add styles to in the future. An example of inline styles: <a href="link.html" style="color: #000; text-decoration: none;">link name</a>
  • 31. Not Encoding Special Characters • Characters like “©” and “&” should be shown with the proper HTML code for the character.
  • 32. Confusing Classes and IDs • Classes are for items that are used more than once on one page. This can be a link style that you’ll call in multiple times on one page but doesn’t follow the global link styling. • IDs are items that are called in just once, like the header div. • Classes and ids are often overused and used in unnecessary places as well. Stick to the minimum amount of classifications that you need.
  • 33. Not Using Unique Names for IDs • It’s very important to choose names that are unique so that it’s easy to edit later on, and easy to identify in your stylesheet. Name your divs specific things like #home-left-column which is better than just #left.