SlideShare une entreprise Scribd logo
1  sur  33
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.

Contenu connexe

Tendances

Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML, CSS & JS - Internship Presentation Week-3Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML, CSS & JS - Internship Presentation Week-3Devang Garach
 
Intro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesIntro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesHeather Rock
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the webIvano Malavolta
 
HTML & CSS Workshop Notes
HTML & CSS Workshop NotesHTML & CSS Workshop Notes
HTML & CSS Workshop NotesPamela Fox
 
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3Jeff Byrnes
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you needDipen Parmar
 
Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#Tamir Dresher
 
HTML Lecture Part 1 of 2
HTML Lecture Part 1 of 2HTML Lecture Part 1 of 2
HTML Lecture Part 1 of 2Sharon Wasden
 
Web Development Using CSS3
Web Development Using CSS3Web Development Using CSS3
Web Development Using CSS3Anjan Mahanta
 
Web Development Using CSS3
Web Development Using CSS3Web Development Using CSS3
Web Development Using CSS3Anjan Mahanta
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsSun Technlogies
 
Modern development paradigms
Modern development paradigmsModern development paradigms
Modern development paradigmsIvano Malavolta
 
Html,javascript & css
Html,javascript & cssHtml,javascript & css
Html,javascript & cssPredhin Sapru
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basicsNikita Garg
 
HTML (Basic to Advance)
HTML (Basic to Advance)HTML (Basic to Advance)
HTML (Basic to Advance)Coder Tech
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSSSyed Sami
 

Tendances (20)

Html (1)
Html (1)Html (1)
Html (1)
 
Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML, CSS & JS - Internship Presentation Week-3Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML, CSS & JS - Internship Presentation Week-3
 
Intro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesIntro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 Slides
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the web
 
HTML & CSS Workshop Notes
HTML & CSS Workshop NotesHTML & CSS Workshop Notes
HTML & CSS Workshop Notes
 
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3
 
Day1
Day1Day1
Day1
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you need
 
Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#
 
HTML Lecture Part 1 of 2
HTML Lecture Part 1 of 2HTML Lecture Part 1 of 2
HTML Lecture Part 1 of 2
 
Web Development Using CSS3
Web Development Using CSS3Web Development Using CSS3
Web Development Using CSS3
 
Web Development Using CSS3
Web Development Using CSS3Web Development Using CSS3
Web Development Using CSS3
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
 
Modern development paradigms
Modern development paradigmsModern development paradigms
Modern development paradigms
 
Html,javascript & css
Html,javascript & cssHtml,javascript & css
Html,javascript & css
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
HTML (Basic to Advance)
HTML (Basic to Advance)HTML (Basic to Advance)
HTML (Basic to Advance)
 
Introduction to WEB HTML, CSS
Introduction to WEB HTML, CSSIntroduction to WEB HTML, CSS
Introduction to WEB HTML, CSS
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
 
Html
HtmlHtml
Html
 

En vedette

The Statistical Significance of &quot;R&quot;
The Statistical Significance of &quot;R&quot;The Statistical Significance of &quot;R&quot;
The Statistical Significance of &quot;R&quot;ppvora
 
Movel Project Presentation - W3C Workshop - English Version
Movel Project  Presentation - W3C Workshop - English VersionMovel Project  Presentation - W3C Workshop - English Version
Movel Project Presentation - W3C Workshop - English VersionThiago Avila, Msc
 
Warthog Photography - Models, Bands/Music, Original Portraiture.
Warthog Photography - Models, Bands/Music, Original Portraiture.Warthog Photography - Models, Bands/Music, Original Portraiture.
Warthog Photography - Models, Bands/Music, Original Portraiture.Warthog Photography
 
Ggplot2
Ggplot2Ggplot2
Ggplot2ppvora
 
BHAG 2: Change
BHAG 2: ChangeBHAG 2: Change
BHAG 2: Changejgaynor
 
Cidadania Movel Project - e-GOIA implementation case Alagoas Demonstrator
Cidadania Movel Project - e-GOIA implementation case Alagoas DemonstratorCidadania Movel Project - e-GOIA implementation case Alagoas Demonstrator
Cidadania Movel Project - e-GOIA implementation case Alagoas DemonstratorThiago Avila, Msc
 
13 anos de gerenciamento de projetos na administração pública estadual
13 anos de gerenciamento de projetos na administração pública estadual13 anos de gerenciamento de projetos na administração pública estadual
13 anos de gerenciamento de projetos na administração pública estadualThiago Avila, Msc
 

En vedette (13)

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

Similaire à Html presentation

Web forms and html (lect 1)
Web forms and html (lect 1)Web forms and html (lect 1)
Web forms and html (lect 1)Salman Memon
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5Vlad Posea
 
Web technologies-course 02.pptx
Web technologies-course 02.pptxWeb technologies-course 02.pptx
Web technologies-course 02.pptxStefan Oprea
 
02 From HTML tags to XHTML
02 From HTML tags to XHTML02 From HTML tags to XHTML
02 From HTML tags to XHTMLRich Dron
 
SDP_-_Module_4.ppt
SDP_-_Module_4.pptSDP_-_Module_4.ppt
SDP_-_Module_4.pptssuser568d77
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSMario Hernandez
 
HTML_JavaScript_Malaysia_2008 (2).ppt
HTML_JavaScript_Malaysia_2008 (2).pptHTML_JavaScript_Malaysia_2008 (2).ppt
HTML_JavaScript_Malaysia_2008 (2).pptDianajeon3
 
FFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTMLFFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTMLToni Kolev
 
WT Module-1.pdf
WT Module-1.pdfWT Module-1.pdf
WT Module-1.pdfRamyaH11
 
LS2.1_V1_HTML.pptx
LS2.1_V1_HTML.pptxLS2.1_V1_HTML.pptx
LS2.1_V1_HTML.pptxLokeshS94
 
Fii Practic Frontend BeeNear - laborator 1
Fii Practic Frontend BeeNear - laborator 1Fii Practic Frontend BeeNear - laborator 1
Fii Practic Frontend BeeNear - laborator 1BeeNear
 
BITM3730Week1.pptx
BITM3730Week1.pptxBITM3730Week1.pptx
BITM3730Week1.pptxMattMarino13
 
Lab#1 - Front End Development
Lab#1 - Front End DevelopmentLab#1 - Front End Development
Lab#1 - Front End DevelopmentWalid Ashraf
 
1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptx1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptxMattMarino13
 

Similaire à Html presentation (20)

xhtml_css.ppt
xhtml_css.pptxhtml_css.ppt
xhtml_css.ppt
 
Html,CSS & UI/UX design
Html,CSS & UI/UX designHtml,CSS & UI/UX design
Html,CSS & UI/UX design
 
Web forms and html (lect 1)
Web forms and html (lect 1)Web forms and html (lect 1)
Web forms and html (lect 1)
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
Web technologies-course 02.pptx
Web technologies-course 02.pptxWeb technologies-course 02.pptx
Web technologies-course 02.pptx
 
02 From HTML tags to XHTML
02 From HTML tags to XHTML02 From HTML tags to XHTML
02 From HTML tags to XHTML
 
SDP_-_Module_4.ppt
SDP_-_Module_4.pptSDP_-_Module_4.ppt
SDP_-_Module_4.ppt
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
ppt.ppt
ppt.pptppt.ppt
ppt.ppt
 
DHTML
DHTMLDHTML
DHTML
 
HTML_JavaScript_Malaysia_2008 (2).ppt
HTML_JavaScript_Malaysia_2008 (2).pptHTML_JavaScript_Malaysia_2008 (2).ppt
HTML_JavaScript_Malaysia_2008 (2).ppt
 
Html5
Html5 Html5
Html5
 
FFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTMLFFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTML
 
WT Module-1.pdf
WT Module-1.pdfWT Module-1.pdf
WT Module-1.pdf
 
LS2.1_V1_HTML.pptx
LS2.1_V1_HTML.pptxLS2.1_V1_HTML.pptx
LS2.1_V1_HTML.pptx
 
Fii Practic Frontend BeeNear - laborator 1
Fii Practic Frontend BeeNear - laborator 1Fii Practic Frontend BeeNear - laborator 1
Fii Practic Frontend BeeNear - laborator 1
 
HTML
HTMLHTML
HTML
 
BITM3730Week1.pptx
BITM3730Week1.pptxBITM3730Week1.pptx
BITM3730Week1.pptx
 
Lab#1 - Front End Development
Lab#1 - Front End DevelopmentLab#1 - Front End Development
Lab#1 - Front End Development
 
1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptx1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptx
 

Dernier

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Dernier (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

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.