SlideShare une entreprise Scribd logo
1  sur  26
Class 13
10 HTML Tag Crimes You Really Shouldn’t Commit
Article from: http://line25.com/articles/10-html-tag-crimes-you-really-
shouldnt-commit
Crime 1: Placing Block Elements
Inside Inline Elements
HTML elements can either be
displayed in two ways, Block or
Inline. Each tag by default is
naturally either a block or inline
element. Block elements include
divs and paragraphs, that make
up the structure of the
document. Inline elements on the
other hand should sit inside block
elements and go with the flow of
the document, examples include
anchors and span tags. With this
in mind, inline elements should
always go inside block elements,
and never the other way around.
Crime 2: Not Including an ALT
Attribute on Images
The ALT attribute is a required
element on all images displayed
on a web page. It helps users
determine what the image is,
should they be browsing on a
screen reader, or simply on a slow
connection. The ALT attribute
should describe the image being
shown, so an alt=”image” is bad
practice. If the image is purely for
decorative purposes, simply add
an empty alt attribute, such as
alt=”".
Crime 3: Not Using Lists When
Necessary
The handy UL (and OL) tags have
a bunch of uses and are
extremely versatile for the display
of all kinds of page items.
Unsurprisingly the Unordered List
tag does a great job of displaying
a list of information, so don’t
even think about using a bunch of
line breaks ever again!
Crime 4: Using <b> and <i> for Bolding
and Italicizing
The <b> and <i> tags make the
text appear bold and italic
respectively, but semantically
they are classed as presentational
tags, therefore the effect would
be best replicated with the CSS
styles of font-weight and font-
style. If the passage of text
suggests areas of importance,
they should be highlighted with
the <strong> or <em> tags, which
basically do the same job as <b>
and <i>, but also make the world
a nicer place.
Crime 5: Using Too Many 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.
Crime 6: Using The Wrong
Strikethrough Tags
In the olden days, <s> and
<strike> were around to allow
edits and amends to web text.
However they are now classed as
deprecated tags, which means
they still work fine (in
Transitional), but there’s a set of
new tags on the block – <del>
and <ins>. These new tags are
used together to show deleted,
and the subsequently inserted
text in a document.
Crime 7: Using Inline Styling
You’ve heard it a thousand times
– Inline styling is bad. The whole
point of semantic HTML and CSS
is to separate document structure
and styling, so it just doesn’t
make sense to go placing styling
directly in the HTML document.
Remember to always keep your
styles in your stylesheet where
they belong.
Crime 8: Adding or Removing Borders
in HTML
The border attribute is another
presentational effect, so
semantically it should be left to
the CSS, even if it’s removing a
default border from an element.
Crime 9: Not Using Header Tags
Header tags are available all the
way from <h1> to <h6>, and make
handy tags to separate your
document into titled sections. If
you have a selection of words
indicating what content is due to
appear next, chances are one of
the header tags will fit right in.
Your choice of header tag
depends on the flow of your
document, try to naturally insert
them in order of 1-6 where
appropriate.
Crime 10: The Unspeakable Use of
<blink> or <marquee>
Apart from not even being part of
the official collection of standard
HTML endorsed by the W3
Consortium, the <blink> and
<marquee> tags are just pure
ugliness. If there’s something you
need to draw attention to, I’m
sure you can think of plenty of
alternate ways to draw focus to
that area of the page than to
have it flash on and off or scroll
across the page!
Table
• Tables are commonly used
on Web pages in two ways:
– To organize information
– To format the layout of an entire Web page
XHTML
Using Tables
• Composed of rows and columns – similar to
a spreadsheet.
• Each individual table cell is at the
intersection of a specific row and column.
• Configured with <table>, <tr>, and <td>
elements
14
XHTML
Table Elements
• <table> Element
Contains the table
Common attributes: border, width, align
• <tr> Element
Contains a table row
• <td> Element
Contains a table cell
• <caption> Element
– Configures a description of the table
15
XHTML
Table Example
<table border="1">
<caption>Birthday List</caption>
<tr>
<td>Name</td>
<td>Birthday</td>
</tr>
<tr>
<td>James</td>
<td>11/08</td>
</tr>
<tr>
<td>Karen</td>
<td>4/17</td>
</tr>
<tr>
<td>Sparky</td>
<td>11/28</td>
</tr>
</table>
16
Birthday List
XHTML
Table Example 2
<table border="1">
<tr>
<th>Name</th>
<th>Birthday</th>
</tr>
<tr>
<td>James</td>
<td>11/08</td>
</tr>
<tr>
<td>Karen</td>
<td>4/17</td>
</tr>
<tr>
<td>Sparky</td>
<td>11/28</td>
</tr>
</table>
17
Using the <th> Element
XHTML
Common Table Attributes
• align (deprecated)
• bgcolor (deprecated)
• border
• cellpadding
• cellspacing
• summary
• width
– Percentage or pixels?
18
XHTML
Common Table Cell Attributes
• align
• bgcolor (deprecated)
• colspan
• rowspan
• valign
• height (deprecated)
• width (deprecated)
19
XHTML
colspan Attribute
<table border="1">
<tr>
<td colspan=“2”>
Birthday List</td>
</tr>
<tr>
<td>James</td>
<td>11/08</td>
</tr>
<tr>
<td>Karen</td>
<td>4/17</td>
</tr>
</table>
20
XHTML
rowspan Attribute
<table border="1">
<tr>
<td rowspan=“2>
<img src=“cake.gif” alt=“cake” height=“100” width=“100” /></td>
<td>James</td>
</tr>
<tr>
<td>11/08</td>
</tr>
</table>
21
Accessibility and Tables
• Use <th> elements to indicate column or
row headings.
• Table element summary attribute
– provide an overview of the table contents
• Complex tables:
Associate table cell values with their
corresponding headers
– <th> tag id attribute
– <td> tag headers attribute
<table border="1" width="75%" summary="This table lists my
educational background. Each row describes educational
experience at a specific school.">
<tr>
<th id="school">School Attended</th>
<th id="years">Years</th>
<th id="subject">Subject</th>
<th id="degree" >Degree Awarded</th>
</tr>
<tr>
<td headers="school">Schaumburg High School</td>
<td headers="years">2000 - 2005</td>
<td headers="subject">College Prep</td>
<td headers="degree">H.S. Diploma</td>
</tr>
</table>
Table Row
Groups
<table border="1" width="75%"
summary="This table lists my
educational background.">
<thead>
<tr>
<th>School Attended</th>
<th>Years</th>
</tr>
</thead>
<tbody>
<tr>
<td>Schaumburg High School</td>
<td>2005 - 2009</td>
</tr>
<tr>
<td>Harper College</td>
<td>2009 - 2010</td>
</tr>
</tbody>
</table>
• <thead>
table head rows
• <tbody >
table body rows
• <tfoot>
table footer rows
Don’t use tables for website layout
• Not a Valid XHTML
• Tables are Inflexible
• Too many tags
• Nested Tables Load More Slowly
• Tables not useful for Search Engine
• Tables Don't Always Print Well
• Tables "break" on various browsers
• Tables and accessibility problems
Using CSS to Style a Table
XHTML
Attribute
CSS Property
align
Align a table: table { width: 75%;
margin: auto; }
Align within a table cell: text-align
bgcolor background-color
cellpadding padding
cellspacing
To configure a shared common border and eliminate space
between table cells: table, td, th { border-collapse: collapse; }
height height
valign vertical-align
width width
background-image

Contenu connexe

Tendances

Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJSBasic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJSDeepak Upadhyay
 
Web Page Designing
Web Page DesigningWeb Page Designing
Web Page DesigningAmit Mali
 
Creating a webpage in html
Creating a webpage in htmlCreating a webpage in html
Creating a webpage in htmlShrey Goswami
 
Introduction to html fundamental concepts
Introduction to html fundamental conceptsIntroduction to html fundamental concepts
Introduction to html fundamental conceptsTsebo Shaun Masilo
 
CSS Foundations, pt 1
CSS Foundations, pt 1CSS Foundations, pt 1
CSS Foundations, pt 1Shawn Calvert
 
How to create a html webpage using notepad
How to create a html webpage using notepadHow to create a html webpage using notepad
How to create a html webpage using notepadSophieBarwick1999
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to htmlpalhaftab
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Hatem Mahmoud
 
Web designing using html
Web designing using htmlWeb designing using html
Web designing using htmljulicris021488
 

Tendances (20)

HTML & CSS Masterclass
HTML & CSS MasterclassHTML & CSS Masterclass
HTML & CSS Masterclass
 
Html basic
Html basicHtml basic
Html basic
 
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJSBasic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
 
Web Page Designing
Web Page DesigningWeb Page Designing
Web Page Designing
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
 
HTML & CSS
HTML & CSSHTML & CSS
HTML & CSS
 
Html 4.0
Html 4.0Html 4.0
Html 4.0
 
Intro Html
Intro HtmlIntro Html
Intro Html
 
Creating a webpage in html
Creating a webpage in htmlCreating a webpage in html
Creating a webpage in html
 
Html notes
Html notesHtml notes
Html notes
 
Introduction to html fundamental concepts
Introduction to html fundamental conceptsIntroduction to html fundamental concepts
Introduction to html fundamental concepts
 
CSS Foundations, pt 1
CSS Foundations, pt 1CSS Foundations, pt 1
CSS Foundations, pt 1
 
How to create a html webpage using notepad
How to create a html webpage using notepadHow to create a html webpage using notepad
How to create a html webpage using notepad
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
Introduction to HTML
Introduction to HTML Introduction to HTML
Introduction to HTML
 
Html
HtmlHtml
Html
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
 
Web designing using html
Web designing using htmlWeb designing using html
Web designing using html
 

En vedette (7)

Class6
Class6Class6
Class6
 
Class 3
Class 3Class 3
Class 3
 
Class15
Class15Class15
Class15
 
Class18
Class18Class18
Class18
 
Class2
Class2Class2
Class2
 
Class 10
Class 10Class 10
Class 10
 
Class11
Class11Class11
Class11
 

Similaire à Class13 (20)

Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML Basics
 
HTML Foundations, part 1
HTML Foundations, part 1HTML Foundations, part 1
HTML Foundations, part 1
 
Html
HtmlHtml
Html
 
CSS
CSSCSS
CSS
 
Lecture-7.pptx
Lecture-7.pptxLecture-7.pptx
Lecture-7.pptx
 
Html basic
Html basicHtml basic
Html basic
 
Html
HtmlHtml
Html
 
Web Design Basics
Web Design BasicsWeb Design Basics
Web Design Basics
 
Week 2-intro-html
Week 2-intro-htmlWeek 2-intro-html
Week 2-intro-html
 
Html ppt computer
Html ppt computerHtml ppt computer
Html ppt computer
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
Web Development 3 (HTML & CSS)
Web Development 3  (HTML & CSS)Web Development 3  (HTML & CSS)
Web Development 3 (HTML & CSS)
 
Html basics
Html basicsHtml basics
Html basics
 
Empowerment Technologies Lecture 10 (Philippines SHS)
Empowerment Technologies Lecture 10 (Philippines SHS)Empowerment Technologies Lecture 10 (Philippines SHS)
Empowerment Technologies Lecture 10 (Philippines SHS)
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshop
 
SDP_-_Module_4.ppt
SDP_-_Module_4.pptSDP_-_Module_4.ppt
SDP_-_Module_4.ppt
 
belajar HTML 3
belajar HTML 3belajar HTML 3
belajar HTML 3
 
Wp unit 1 (1)
Wp  unit 1 (1)Wp  unit 1 (1)
Wp unit 1 (1)
 
Css Introduction
Css IntroductionCss Introduction
Css Introduction
 
1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf
 

Plus de Jiyeon Lee (13)

Cultural conflict resolution
Cultural conflict resolutionCultural conflict resolution
Cultural conflict resolution
 
Class22
Class22Class22
Class22
 
Class 21
Class 21Class 21
Class 21
 
Class 21
Class 21Class 21
Class 21
 
Class 20
Class 20Class 20
Class 20
 
Class19
Class19Class19
Class19
 
Class 17
Class 17Class 17
Class 17
 
Class14
Class14Class14
Class14
 
Class 12
Class 12Class 12
Class 12
 
Class8
Class8Class8
Class8
 
Class7
Class7Class7
Class7
 
Class5
Class5Class5
Class5
 
Class4
Class4Class4
Class4
 

Dernier

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 

Dernier (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 

Class13

  • 2. 10 HTML Tag Crimes You Really Shouldn’t Commit Article from: http://line25.com/articles/10-html-tag-crimes-you-really- shouldnt-commit
  • 3. Crime 1: Placing Block Elements Inside Inline Elements HTML elements can either be displayed in two ways, Block or Inline. Each tag by default is naturally either a block or inline element. Block elements include divs and paragraphs, that make up the structure of the document. Inline elements on the other hand should sit inside block elements and go with the flow of the document, examples include anchors and span tags. With this in mind, inline elements should always go inside block elements, and never the other way around.
  • 4. Crime 2: Not Including an ALT Attribute on Images The ALT attribute is a required element on all images displayed on a web page. It helps users determine what the image is, should they be browsing on a screen reader, or simply on a slow connection. The ALT attribute should describe the image being shown, so an alt=”image” is bad practice. If the image is purely for decorative purposes, simply add an empty alt attribute, such as alt=”".
  • 5. Crime 3: Not Using Lists When Necessary The handy UL (and OL) tags have a bunch of uses and are extremely versatile for the display of all kinds of page items. Unsurprisingly the Unordered List tag does a great job of displaying a list of information, so don’t even think about using a bunch of line breaks ever again!
  • 6. Crime 4: Using <b> and <i> for Bolding and Italicizing The <b> and <i> tags make the text appear bold and italic respectively, but semantically they are classed as presentational tags, therefore the effect would be best replicated with the CSS styles of font-weight and font- style. If the passage of text suggests areas of importance, they should be highlighted with the <strong> or <em> tags, which basically do the same job as <b> and <i>, but also make the world a nicer place.
  • 7. Crime 5: Using Too Many 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.
  • 8. Crime 6: Using The Wrong Strikethrough Tags In the olden days, <s> and <strike> were around to allow edits and amends to web text. However they are now classed as deprecated tags, which means they still work fine (in Transitional), but there’s a set of new tags on the block – <del> and <ins>. These new tags are used together to show deleted, and the subsequently inserted text in a document.
  • 9. Crime 7: Using Inline Styling You’ve heard it a thousand times – Inline styling is bad. The whole point of semantic HTML and CSS is to separate document structure and styling, so it just doesn’t make sense to go placing styling directly in the HTML document. Remember to always keep your styles in your stylesheet where they belong.
  • 10. Crime 8: Adding or Removing Borders in HTML The border attribute is another presentational effect, so semantically it should be left to the CSS, even if it’s removing a default border from an element.
  • 11. Crime 9: Not Using Header Tags Header tags are available all the way from <h1> to <h6>, and make handy tags to separate your document into titled sections. If you have a selection of words indicating what content is due to appear next, chances are one of the header tags will fit right in. Your choice of header tag depends on the flow of your document, try to naturally insert them in order of 1-6 where appropriate.
  • 12. Crime 10: The Unspeakable Use of <blink> or <marquee> Apart from not even being part of the official collection of standard HTML endorsed by the W3 Consortium, the <blink> and <marquee> tags are just pure ugliness. If there’s something you need to draw attention to, I’m sure you can think of plenty of alternate ways to draw focus to that area of the page than to have it flash on and off or scroll across the page!
  • 13. Table • Tables are commonly used on Web pages in two ways: – To organize information – To format the layout of an entire Web page
  • 14. XHTML Using Tables • Composed of rows and columns – similar to a spreadsheet. • Each individual table cell is at the intersection of a specific row and column. • Configured with <table>, <tr>, and <td> elements 14
  • 15. XHTML Table Elements • <table> Element Contains the table Common attributes: border, width, align • <tr> Element Contains a table row • <td> Element Contains a table cell • <caption> Element – Configures a description of the table 15
  • 16. XHTML Table Example <table border="1"> <caption>Birthday List</caption> <tr> <td>Name</td> <td>Birthday</td> </tr> <tr> <td>James</td> <td>11/08</td> </tr> <tr> <td>Karen</td> <td>4/17</td> </tr> <tr> <td>Sparky</td> <td>11/28</td> </tr> </table> 16 Birthday List
  • 17. XHTML Table Example 2 <table border="1"> <tr> <th>Name</th> <th>Birthday</th> </tr> <tr> <td>James</td> <td>11/08</td> </tr> <tr> <td>Karen</td> <td>4/17</td> </tr> <tr> <td>Sparky</td> <td>11/28</td> </tr> </table> 17 Using the <th> Element
  • 18. XHTML Common Table Attributes • align (deprecated) • bgcolor (deprecated) • border • cellpadding • cellspacing • summary • width – Percentage or pixels? 18
  • 19. XHTML Common Table Cell Attributes • align • bgcolor (deprecated) • colspan • rowspan • valign • height (deprecated) • width (deprecated) 19
  • 20. XHTML colspan Attribute <table border="1"> <tr> <td colspan=“2”> Birthday List</td> </tr> <tr> <td>James</td> <td>11/08</td> </tr> <tr> <td>Karen</td> <td>4/17</td> </tr> </table> 20
  • 21. XHTML rowspan Attribute <table border="1"> <tr> <td rowspan=“2> <img src=“cake.gif” alt=“cake” height=“100” width=“100” /></td> <td>James</td> </tr> <tr> <td>11/08</td> </tr> </table> 21
  • 22. Accessibility and Tables • Use <th> elements to indicate column or row headings. • Table element summary attribute – provide an overview of the table contents • Complex tables: Associate table cell values with their corresponding headers – <th> tag id attribute – <td> tag headers attribute
  • 23. <table border="1" width="75%" summary="This table lists my educational background. Each row describes educational experience at a specific school."> <tr> <th id="school">School Attended</th> <th id="years">Years</th> <th id="subject">Subject</th> <th id="degree" >Degree Awarded</th> </tr> <tr> <td headers="school">Schaumburg High School</td> <td headers="years">2000 - 2005</td> <td headers="subject">College Prep</td> <td headers="degree">H.S. Diploma</td> </tr> </table>
  • 24. Table Row Groups <table border="1" width="75%" summary="This table lists my educational background."> <thead> <tr> <th>School Attended</th> <th>Years</th> </tr> </thead> <tbody> <tr> <td>Schaumburg High School</td> <td>2005 - 2009</td> </tr> <tr> <td>Harper College</td> <td>2009 - 2010</td> </tr> </tbody> </table> • <thead> table head rows • <tbody > table body rows • <tfoot> table footer rows
  • 25. Don’t use tables for website layout • Not a Valid XHTML • Tables are Inflexible • Too many tags • Nested Tables Load More Slowly • Tables not useful for Search Engine • Tables Don't Always Print Well • Tables "break" on various browsers • Tables and accessibility problems
  • 26. Using CSS to Style a Table XHTML Attribute CSS Property align Align a table: table { width: 75%; margin: auto; } Align within a table cell: text-align bgcolor background-color cellpadding padding cellspacing To configure a shared common border and eliminate space between table cells: table, td, th { border-collapse: collapse; } height height valign vertical-align width width background-image