SlideShare a Scribd company logo
1 of 80
Knowledge Sharing Session on
HTML and CSS
Basic HTML and CSS
Ferdous Mahmud Shaon
February 2014
HTML, XHTML, HTML5
HTML Tags and Nested Tags
HTML Basic Structure
HTML <head> and <title>
HTML <body>
HTML Headlines
HTML Paragraphs
HTML Lists
HTML Divisions (sections)
HTML Images
HTML form
HTML frameset
• Not recommended tag
• Not supported in HTML5
HTML tables
HTML Block vs Inline elements
• Block Elements
– Takes up the full width available, and has a line
break before and after it.
– <p>, <div>, <h1>…. <h6>, <ul>, <ol>, <li>, <table>
• Inline Elements
– Takes up only as much width as necessary, and
does not force line breaks after it.
– <a>, <span>, <img>
HTML Block elements
HTML Block Elements
HTML Inline Elements
HTML Table vs DIV
• Most websites have put their content in multiple columns.
• Multiple columns can be created by using <div> or <table>
elements.
• Even though it is possible to create nice layouts with HTML
tables, tables were designed for presenting tabular data -
NOT as a layout tool!
• The div element is used for grouping HTML elements and
for creating rows and columns with the help of CSS.
HTML Page Layout
HTML Layout
HTML Layout
HTML Layout
HTML Layout
HTML <!DOCTYPE>
• Must be the very first thing in HTML document,
even before the <html> tag
• Provides information to the web browser about
what version of HTML the page is written in.
• In HTML 4, the <!DOCTYPE> declaration refers to a
DTD, but in HTML5, the <!DOCTYPE> declaration
does NOT refer to any DTD.
HTML <!DOCTYPE>
HTML Character Entities
HTML vs XHTML
XHTML
– eXtensible HyperText Markup Language
– Stricter and cleaner version of HTML similar to
XML
– Better cross browser support
HTML vs XHTML
XHTML DOCTYPE
– mandatory
XHTML elements
– must be properly nested
– must always be closed
– must be in lowercase
– must have one root element
XHTML attributes
– names must be in lower case
– values must be quoted
– minimization is forbidden
• <input type="checkbox" checked="checked" />
• <input disabled="disabled" />
SEO friendly HTML
• Meaningful and relevant HTML <title> per page
• Define <meta> description and keywords for each page.
<meta name="description" content="Free Web tutorials on HTML and CSS">
<meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
• Use an <h1> tag for the main headline of the page. It shouldn’t be
more than one in a single page.
• Relevant sub-headlines should use an <h2>…<h6> tags according to
their priority.
• Avoid embedded JS and CSS whenever possible. Try to use external
CSS and JS and if possible minimize them.
New HTML5 Tags
• <canvas> defines graphic drawing using
JavaScript
• <audio> defines sound or music content
• <video> defines video or movie content
• <header> defines a header for the document
or a section
• <nav> defines navigation links in the document
New HTML5 Tags
• <section> defines a section in the document
• <main> defines the main content of a
document
• <article> defines an article in the document
• <footer> defines a footer for the document or
a section
• <figure> defines self-contained content, like
illustrations, diagrams, photos etc.
HTML Style Elements
<font>, <strong>, <b>, <u>, <i>, <em>, <center>
What is CSS?
• Cascading Style Sheets
• Defines how to display HTML elements
• Added to HTML 4.0
• Current version is CSS 2.
• CSS 3 is also released and supported by most
of the browsers.
How to use CSS
CSS Rules
CSS Selectors
CSS Selectors
CSS Selectors
Multiple CSS Rules
Multiple CSS Rules
CSS Selector Priority
CSS class vs id selector
CSS Descendent Selector
CSS Descendent Selector
CSS Box Model (block element)
CSS Box Model (block element)
CSS Box Model (block element)
CSS Box Model – Margin Collapse
CSS Box Model – Margin Collapse
CSS Box Model – Margin Collapse
CSS Box Model – Margin Collapse
CSS Box Model – Margin Collapse
CSS Box Model (inline element)
CSS Box Model (inline element)
CSS Box Model Shortcuts
CSS Box Model Dimensions
CSS Box Model and Box Sizing
• CSS3 Property
– box-sizing: content-box; /* Default value */
– box-sizing: border-box; /* Grid in Twitter Bootstrap */
CSS Dimension
• height
– Sets the height of an element
• max-height
– Sets the maximum height of an element
• min-height
– Sets the minimum height of an element
• width
– Sets the width of an element
• max-width
– Sets the maximum width of an element
• min-width
– Sets the minimum width of an element
Display and Visibility
• Hiding an Element
– display:none (doesn’t take space)
– visibility:hidden (takes space)
• Styling block / inline HTML Element
– ul.menu li { display:inline; }
– div.data span { display:block; }
Building Menu using HTML & CSS
Building Menu using HTML & CSS
CSS ‘position’ Property
• static
– default value
– not affected by top, right, bottom, left
• relative
– positioned relative to its normal position
• absolute
– positioned relative to the nearest relatively positioned ancestor
– if no relatively positioned ancestors, then it uses the document body
• fixed
– positioned relative to the viewport
– always stays in the same place even if the page is scrolled.
CSS Relative Positioning
CSS Absolute Positioning
CSS Relative and Absolute Positioning
CSS Fixed Positioning
CSS Floating
CSS Floating Problem
CSS Floating Issues
CSS Floating Issues
CSS Floating Issues
Grouping and Nesting Selectors
• Grouping Selectors
– div, p, span {
font-family: "Helvetica Neue", Arial, Helvetica;
}
• Nesting Selectors
– #main .data p { color:blue; }
– .widget.data p { color:blue; }
– #main .data > p { color:blue; }
CSS Pseudo-classes Selectors
• Syntax:
selector:pseudo-class { property:value; }
• Anchor Pseudo-classes
– a:link {color:#FF0000;} /* unvisited link */
– a:visited {color:#00FF00;} /* visited link */
– a:hover {color:#FF00FF;} /* mouse over link */
– a:active {color:#0000FF;} /* selected link */
• First-child Pseudo-class
– ul.menu > li:first-child { margin-left:0; }
CSS Opacity / Transparency
• Transparency
– opacity:0.5;
– filter:alpha(opacity=50); /* For old IEs */
• Cross browser Transparency
.transparent {
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
filter: alpha(opacity=50); /* IE 5-7 */
-moz-opacity: 0.5; /* Netscape */
-khtml-opacity: 0.5; /* Safari 1.x */
opacity: 0.5; /* Good browsers */
}
CSS Image Sprites
• An image sprite is a collection of images put
into a single image.
• Reduces load time and saves bandwidth.
• img.home { width:46px; height:44px;
background:url(img_navsprites.gif) 0 0; }
• img.next { width:43px; height:44px;
background:url(img_navsprites.gif) -91px 0; }
CSS Hacks - IE Detection and
Conditional CSS
• http://www.sitepoint.com/microsoft-drop-ie10-conditional-comments/
• http://msdn.microsoft.com/en-us/library/ms537512%28VS.85%29.aspx
<!--[if IE]>
<p>You are using Internet Explorer >=5 and <= 9.</p>
<![endif]-->
<![if !IE]>
<p>You are using Internet Explorer >=10 or other browsers.</p>
<![endif]>
• Using jQuery for jQuery < 1.9
if (jQuery.browser.msie && jQuery.browser.version < 8) {
// do something
}
CSS Hacks
• IE7 doesn’t understand ‘display: inline-block’
1. display:block;
float:left;
2. display: inline-block;
*display: inline;
zoom: 1;
CSS – major IE6 Problem
• IE6 doesn't support multiple class selectors.
• So when we write,
div.menu.horizontal.widget { color: blue; }
in IE6, the above style is interpreted as:
div.widget { color: blue; }
• This style definition affects all div elements
having widget style class.
Thank You!

More Related Content

What's hot

How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksAmit Tyagi
 
Basic HTML
Basic HTMLBasic HTML
Basic HTMLSayan De
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSMario Hernandez
 
Html text and formatting
Html text and formattingHtml text and formatting
Html text and formattingeShikshak
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS PresentationShawn Calvert
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptFahim Abdullah
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation joilrahat
 
Web development using HTML and CSS
Web development using HTML and CSSWeb development using HTML and CSS
Web development using HTML and CSSSiddhantSingh980217
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to htmlveena parihar
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3Doris Chen
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to htmlpalhaftab
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5IT Geeks
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginnersSingsys Pte Ltd
 
Css Complete Notes
Css Complete NotesCss Complete Notes
Css Complete NotesEPAM Systems
 

What's hot (20)

Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 
Web Development using HTML & CSS
Web Development using HTML & CSSWeb Development using HTML & CSS
Web Development using HTML & CSS
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
CSS
CSSCSS
CSS
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Html text and formatting
Html text and formattingHtml text and formatting
Html text and formatting
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation
 
Web development using HTML and CSS
Web development using HTML and CSSWeb development using HTML and CSS
Web development using HTML and CSS
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Intro to html 5
Intro to html 5Intro to html 5
Intro to html 5
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
CSS
CSSCSS
CSS
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
Css Complete Notes
Css Complete NotesCss Complete Notes
Css Complete Notes
 

Viewers also liked

Div tag presentation
Div tag presentationDiv tag presentation
Div tag presentationalyssa_lum11
 
The history of social networks: how it all began
The history of social networks: how it all beganThe history of social networks: how it all began
The history of social networks: how it all beganJailson Lima
 
10 things that make a good music video
10 things that make a good music video10 things that make a good music video
10 things that make a good music video09hamiltonkia
 
History of Social Media
History of Social MediaHistory of Social Media
History of Social MediaBob Crawshaw
 
A Brief History Of Social Media
A Brief History Of Social MediaA Brief History Of Social Media
A Brief History Of Social MediaConnie Piggott
 
Ip addressing
Ip addressingIp addressing
Ip addressingOnline
 
Introduction to photoshop
Introduction to photoshopIntroduction to photoshop
Introduction to photoshopReymart Canuel
 
Presentation on Adobe Photoshop
Presentation on Adobe PhotoshopPresentation on Adobe Photoshop
Presentation on Adobe PhotoshopMohak Jain
 
Fundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersFundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersLemi Orhan Ergin
 
Web fundamental 4 developers
Web fundamental 4 developersWeb fundamental 4 developers
Web fundamental 4 developersIdo Green
 
Tessel: The End of Web Development (as we know it)
Tessel: The End of Web Development (as we know it)Tessel: The End of Web Development (as we know it)
Tessel: The End of Web Development (as we know it)TechnicalMachine
 
SIWES I.T REPORT ON WEB DESIGN
SIWES I.T REPORT ON WEB DESIGNSIWES I.T REPORT ON WEB DESIGN
SIWES I.T REPORT ON WEB DESIGNEjiro Ndifereke
 
Web Development Ppt
Web Development PptWeb Development Ppt
Web Development PptBruce Tucker
 
Nikos Markatos - NTUA
Nikos Markatos - NTUANikos Markatos - NTUA
Nikos Markatos - NTUAWWW.ERFC.GR
 
Web development Training In Batra Computer Centre
Web development Training In Batra Computer CentreWeb development Training In Batra Computer Centre
Web development Training In Batra Computer CentreBatra Computer Centre
 

Viewers also liked (20)

Div tag presentation
Div tag presentationDiv tag presentation
Div tag presentation
 
Social networking
Social networkingSocial networking
Social networking
 
The history of social networks: how it all began
The history of social networks: how it all beganThe history of social networks: how it all began
The history of social networks: how it all began
 
10 things that make a good music video
10 things that make a good music video10 things that make a good music video
10 things that make a good music video
 
Span and Div tags in HTML
Span and Div tags in HTMLSpan and Div tags in HTML
Span and Div tags in HTML
 
History of Social Media
History of Social MediaHistory of Social Media
History of Social Media
 
A Brief History Of Social Media
A Brief History Of Social MediaA Brief History Of Social Media
A Brief History Of Social Media
 
Css.html
Css.htmlCss.html
Css.html
 
Ip addressing
Ip addressingIp addressing
Ip addressing
 
Brief history of social media
Brief history of social mediaBrief history of social media
Brief history of social media
 
Introduction to photoshop
Introduction to photoshopIntroduction to photoshop
Introduction to photoshop
 
Digital Storytelling
Digital StorytellingDigital Storytelling
Digital Storytelling
 
Presentation on Adobe Photoshop
Presentation on Adobe PhotoshopPresentation on Adobe Photoshop
Presentation on Adobe Photoshop
 
Fundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersFundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-Developers
 
Web fundamental 4 developers
Web fundamental 4 developersWeb fundamental 4 developers
Web fundamental 4 developers
 
Tessel: The End of Web Development (as we know it)
Tessel: The End of Web Development (as we know it)Tessel: The End of Web Development (as we know it)
Tessel: The End of Web Development (as we know it)
 
SIWES I.T REPORT ON WEB DESIGN
SIWES I.T REPORT ON WEB DESIGNSIWES I.T REPORT ON WEB DESIGN
SIWES I.T REPORT ON WEB DESIGN
 
Web Development Ppt
Web Development PptWeb Development Ppt
Web Development Ppt
 
Nikos Markatos - NTUA
Nikos Markatos - NTUANikos Markatos - NTUA
Nikos Markatos - NTUA
 
Web development Training In Batra Computer Centre
Web development Training In Batra Computer CentreWeb development Training In Batra Computer Centre
Web development Training In Batra Computer Centre
 

Similar to Knowledge Sharing Session on HTML and CSS Basics

Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2Sónia
 
UVA MDST 3073 CSS 2012-09-20
UVA MDST 3073 CSS 2012-09-20UVA MDST 3073 CSS 2012-09-20
UVA MDST 3073 CSS 2012-09-20Rafael Alvarado
 
Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01Likitha47
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmithaps4
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptxMattMarino13
 
FFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTMLFFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTMLToni Kolev
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshMukesh Kumar
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmitha273566
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptxMattMarino13
 
W3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayW3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayadeveria
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)Webtech Learning
 

Similar to Knowledge Sharing Session on HTML and CSS Basics (20)

css v1 guru
css v1 gurucss v1 guru
css v1 guru
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
 
Css intro
Css introCss intro
Css intro
 
Css
CssCss
Css
 
UVA MDST 3073 CSS 2012-09-20
UVA MDST 3073 CSS 2012-09-20UVA MDST 3073 CSS 2012-09-20
UVA MDST 3073 CSS 2012-09-20
 
Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptx
 
FFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTMLFFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTML
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Web
WebWeb
Web
 
CSS
CSSCSS
CSS
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
 
W3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayW3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use today
 
Web Development - Lecture 5
Web Development - Lecture 5Web Development - Lecture 5
Web Development - Lecture 5
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
Basic css
Basic cssBasic css
Basic css
 

More from Ferdous Mahmud Shaon

Getting started with Test Driven Development
Getting started with Test Driven DevelopmentGetting started with Test Driven Development
Getting started with Test Driven DevelopmentFerdous Mahmud Shaon
 
Tips to Kick-start your Software Engineering Career
Tips to Kick-start your Software Engineering CareerTips to Kick-start your Software Engineering Career
Tips to Kick-start your Software Engineering CareerFerdous Mahmud Shaon
 
Effective Java - Override clone() method judiciously
Effective Java - Override clone() method judiciouslyEffective Java - Override clone() method judiciously
Effective Java - Override clone() method judiciously Ferdous Mahmud Shaon
 
Effective Java - Always override toString() method
Effective Java - Always override toString() methodEffective Java - Always override toString() method
Effective Java - Always override toString() methodFerdous Mahmud Shaon
 

More from Ferdous Mahmud Shaon (6)

Getting started with Test Driven Development
Getting started with Test Driven DevelopmentGetting started with Test Driven Development
Getting started with Test Driven Development
 
Tips to Kick-start your Software Engineering Career
Tips to Kick-start your Software Engineering CareerTips to Kick-start your Software Engineering Career
Tips to Kick-start your Software Engineering Career
 
Business Communcation
Business CommuncationBusiness Communcation
Business Communcation
 
Effective Java - Override clone() method judiciously
Effective Java - Override clone() method judiciouslyEffective Java - Override clone() method judiciously
Effective Java - Override clone() method judiciously
 
Effective Java - Always override toString() method
Effective Java - Always override toString() methodEffective Java - Always override toString() method
Effective Java - Always override toString() method
 
Composite Design Pattern
Composite Design PatternComposite Design Pattern
Composite Design Pattern
 

Recently uploaded

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

Knowledge Sharing Session on HTML and CSS Basics

  • 1. Knowledge Sharing Session on HTML and CSS Basic HTML and CSS Ferdous Mahmud Shaon February 2014
  • 3. HTML Tags and Nested Tags
  • 5. HTML <head> and <title>
  • 13. HTML frameset • Not recommended tag • Not supported in HTML5
  • 15. HTML Block vs Inline elements • Block Elements – Takes up the full width available, and has a line break before and after it. – <p>, <div>, <h1>…. <h6>, <ul>, <ol>, <li>, <table> • Inline Elements – Takes up only as much width as necessary, and does not force line breaks after it. – <a>, <span>, <img>
  • 19. HTML Table vs DIV • Most websites have put their content in multiple columns. • Multiple columns can be created by using <div> or <table> elements. • Even though it is possible to create nice layouts with HTML tables, tables were designed for presenting tabular data - NOT as a layout tool! • The div element is used for grouping HTML elements and for creating rows and columns with the help of CSS.
  • 25. HTML <!DOCTYPE> • Must be the very first thing in HTML document, even before the <html> tag • Provides information to the web browser about what version of HTML the page is written in. • In HTML 4, the <!DOCTYPE> declaration refers to a DTD, but in HTML5, the <!DOCTYPE> declaration does NOT refer to any DTD.
  • 28. HTML vs XHTML XHTML – eXtensible HyperText Markup Language – Stricter and cleaner version of HTML similar to XML – Better cross browser support
  • 29. HTML vs XHTML XHTML DOCTYPE – mandatory XHTML elements – must be properly nested – must always be closed – must be in lowercase – must have one root element XHTML attributes – names must be in lower case – values must be quoted – minimization is forbidden • <input type="checkbox" checked="checked" /> • <input disabled="disabled" />
  • 30. SEO friendly HTML • Meaningful and relevant HTML <title> per page • Define <meta> description and keywords for each page. <meta name="description" content="Free Web tutorials on HTML and CSS"> <meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript"> • Use an <h1> tag for the main headline of the page. It shouldn’t be more than one in a single page. • Relevant sub-headlines should use an <h2>…<h6> tags according to their priority. • Avoid embedded JS and CSS whenever possible. Try to use external CSS and JS and if possible minimize them.
  • 31. New HTML5 Tags • <canvas> defines graphic drawing using JavaScript • <audio> defines sound or music content • <video> defines video or movie content • <header> defines a header for the document or a section • <nav> defines navigation links in the document
  • 32. New HTML5 Tags • <section> defines a section in the document • <main> defines the main content of a document • <article> defines an article in the document • <footer> defines a footer for the document or a section • <figure> defines self-contained content, like illustrations, diagrams, photos etc.
  • 33. HTML Style Elements <font>, <strong>, <b>, <u>, <i>, <em>, <center>
  • 34. What is CSS? • Cascading Style Sheets • Defines how to display HTML elements • Added to HTML 4.0 • Current version is CSS 2. • CSS 3 is also released and supported by most of the browsers.
  • 35. How to use CSS
  • 43. CSS class vs id selector
  • 46. CSS Box Model (block element)
  • 47. CSS Box Model (block element)
  • 48. CSS Box Model (block element)
  • 49. CSS Box Model – Margin Collapse
  • 50. CSS Box Model – Margin Collapse
  • 51. CSS Box Model – Margin Collapse
  • 52. CSS Box Model – Margin Collapse
  • 53. CSS Box Model – Margin Collapse
  • 54. CSS Box Model (inline element)
  • 55. CSS Box Model (inline element)
  • 56. CSS Box Model Shortcuts
  • 57. CSS Box Model Dimensions
  • 58. CSS Box Model and Box Sizing • CSS3 Property – box-sizing: content-box; /* Default value */ – box-sizing: border-box; /* Grid in Twitter Bootstrap */
  • 59. CSS Dimension • height – Sets the height of an element • max-height – Sets the maximum height of an element • min-height – Sets the minimum height of an element • width – Sets the width of an element • max-width – Sets the maximum width of an element • min-width – Sets the minimum width of an element
  • 60. Display and Visibility • Hiding an Element – display:none (doesn’t take space) – visibility:hidden (takes space) • Styling block / inline HTML Element – ul.menu li { display:inline; } – div.data span { display:block; }
  • 61. Building Menu using HTML & CSS
  • 62. Building Menu using HTML & CSS
  • 63. CSS ‘position’ Property • static – default value – not affected by top, right, bottom, left • relative – positioned relative to its normal position • absolute – positioned relative to the nearest relatively positioned ancestor – if no relatively positioned ancestors, then it uses the document body • fixed – positioned relative to the viewport – always stays in the same place even if the page is scrolled.
  • 66. CSS Relative and Absolute Positioning
  • 73. Grouping and Nesting Selectors • Grouping Selectors – div, p, span { font-family: "Helvetica Neue", Arial, Helvetica; } • Nesting Selectors – #main .data p { color:blue; } – .widget.data p { color:blue; } – #main .data > p { color:blue; }
  • 74. CSS Pseudo-classes Selectors • Syntax: selector:pseudo-class { property:value; } • Anchor Pseudo-classes – a:link {color:#FF0000;} /* unvisited link */ – a:visited {color:#00FF00;} /* visited link */ – a:hover {color:#FF00FF;} /* mouse over link */ – a:active {color:#0000FF;} /* selected link */ • First-child Pseudo-class – ul.menu > li:first-child { margin-left:0; }
  • 75. CSS Opacity / Transparency • Transparency – opacity:0.5; – filter:alpha(opacity=50); /* For old IEs */ • Cross browser Transparency .transparent { /* IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; filter: alpha(opacity=50); /* IE 5-7 */ -moz-opacity: 0.5; /* Netscape */ -khtml-opacity: 0.5; /* Safari 1.x */ opacity: 0.5; /* Good browsers */ }
  • 76. CSS Image Sprites • An image sprite is a collection of images put into a single image. • Reduces load time and saves bandwidth. • img.home { width:46px; height:44px; background:url(img_navsprites.gif) 0 0; } • img.next { width:43px; height:44px; background:url(img_navsprites.gif) -91px 0; }
  • 77. CSS Hacks - IE Detection and Conditional CSS • http://www.sitepoint.com/microsoft-drop-ie10-conditional-comments/ • http://msdn.microsoft.com/en-us/library/ms537512%28VS.85%29.aspx <!--[if IE]> <p>You are using Internet Explorer >=5 and <= 9.</p> <![endif]--> <![if !IE]> <p>You are using Internet Explorer >=10 or other browsers.</p> <![endif]> • Using jQuery for jQuery < 1.9 if (jQuery.browser.msie && jQuery.browser.version < 8) { // do something }
  • 78. CSS Hacks • IE7 doesn’t understand ‘display: inline-block’ 1. display:block; float:left; 2. display: inline-block; *display: inline; zoom: 1;
  • 79. CSS – major IE6 Problem • IE6 doesn't support multiple class selectors. • So when we write, div.menu.horizontal.widget { color: blue; } in IE6, the above style is interpreted as: div.widget { color: blue; } • This style definition affects all div elements having widget style class.