SlideShare a Scribd company logo
8
Some HTML tag examplesHeadings
Most read
16
Links <a href=“http://www.google.com”>Google</a>
Most read
19
Most can have:<h1 id=“mainHeading” class=“myHeadingClass” title=“Website title” style=“color: #000000;”>My Heading</h1>
Most read
(Fast) Introduction to HTML & CSSDave Kelly ( @davkell  )for @091Labs
What are HTML & CSS?HTML structures documents on the webTells browser what content is (not what it means)CSS = presentation (how things look)JavaScript adds interaction / behavioursPeanut lifted from http://www.alistapart.com/articles/understandingprogressiveenhancement/Why separate?http://www.ambientage.com/blog/091labs : 1
Standards.... define the mark-up you use tell the browser what to do with itHTML 4.01 (Don’t use)xHTML1.0Frameset  (nope)Transitional  (nope)Strict	*HTML5 (New. Not fully supported / implemented. It’s the future.)All those defined standards....do all browsers work the same?
ToolsFirefox (wide support for standards)Firebug (Firefox add-on, Chrome also, but weak). Your best friend with front-end web dev.Web Developer Toolbar (Firefox add-on)ValidatorsHTML: http://validator.w3.orgCSS: http://jigsaw.w3.orgDevelopment environmentNetbeans / Aptana for me.... Your choice (not WYSIWYG!!)(My) Development processFirefox -> Webkit (chrome / safari) -> IE8 -> IE7 -> (IE6?)Browsershots.orghttp://www.ambientage.com/blog/091labs : 2
HTMLMade up of “tags”  (elements)<h1>I’m an important heading</h1> (Heading level 1)  <img src=”images/myprofilepic.jpg” alt=”It’s a picture of me!!” /> (Image tag)Elements can contain plain text, other elements, or bothNo state / no logic (Mark-up content only, not programming)xHTML Strict elements...must be properly nestedmust be closedmust be lower caseattributes must have a value
HTML TagsTags are usually paired (e.g..., <h1> and </h1>) Some elements are “self-closing” e.g. <br /> <img … />Some elements may include attributes, (additional information that is included inside the start tag).Every HTML document contains standard tags. Each document consists of a head and body The head contains the title (and more…), and The body contains the actual text that is made up of paragraphs, lists, images, and other elements
Simple HTML Examplehttp://www.ambientage.com/blog/091labs : 3
Some HTML tag examplesHeadings
 <h1></h1>  , <h2> </h2> ……  <h6> </h6>
Paragraph: <p>Some text </p>
Lists
 Ordered List <ol> <li>I’m a list item</li></ol>
 Unordered list <ul>  <li>I’m a list item</li> </ul>
Document Section <div></div>   (Important for page layouts!)
Image <img src=“../images/mypic.jpg” alt=“My Picture” title=“It’s me!” />
Links <a href=“http://www.google.com”>Google</a>
Table  <table><tr><td>table cell</td></tr>                          <tr><td>second row cell</td></tr>             </table>http://www.ambientage.com/blog/091labs : 4 & 5
Some HTML attribute examplesHTML tags can have attributes => give some more info about the tag
Most can have:<h1 id=“mainHeading” class=“myHeadingClass” title=“Website title” style=“color: #000000;”>My Heading</h1>
HTML FormsForms are used to accept information from the Web page userForms can use text boxes, password boxes, check boxes, radio buttons, text areas, drop-down lists, hidden fields, as well as Submit and Clear buttons.To create a form, the <form></form> element is used.Forms have 2 basic attributes: action & method, e.g., <form name=“myForm” action=“processPage.php” method=“post”>action = “where’s the data going?”method = “how’s it getting there? (post vs get)”
HTML Forms
HTML Forms
CSS (Cascading Style Sheets)Handles presentation of web page

More Related Content

What's hot (20)

Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
Shawn Calvert
 
Web Development using HTML & CSS
Web Development using HTML & CSSWeb Development using HTML & CSS
Web Development using HTML & CSS
Shashank Skills Academy
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Amit Tyagi
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
Walid Ashraf
 
CSS
CSSCSS
CSS
People Strategists
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Mario Hernandez
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
Amit Kumar Singh
 
Css selectors
Css selectorsCss selectors
Css selectors
Parth Trivedi
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Gil Fink
 
Css Ppt
Css PptCss Ppt
Css Ppt
Hema Prasanth
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
Java script
Java scriptJava script
Java script
Abhishek Kesharwani
 
Javascript
JavascriptJavascript
Javascript
mussawir20
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
Sayan De
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
BG Java EE Course
 
Eye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easilyEye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easily
shabab shihan
 
Html coding
Html codingHtml coding
Html coding
Briana VanBuskirk
 
Introduction to JavaScript Basics.
Introduction to JavaScript Basics.Introduction to JavaScript Basics.
Introduction to JavaScript Basics.
Hassan Ahmed Baig - Web Developer
 
Html table
Html tableHtml table
Html table
JayjZens
 

Viewers also liked (10)

Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Ferdous Mahmud Shaon
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
Amit Tyagi
 
HTML with a little CSS
HTML with a little CSS HTML with a little CSS
HTML with a little CSS
Basia Madej
 
HTML5 and CSS3 Refresher
HTML5 and CSS3 RefresherHTML5 and CSS3 Refresher
HTML5 and CSS3 Refresher
Ivano Malavolta
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
Gopi A
 
Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3
Pradeep Varadaraja Banavara
 
Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1
Oleksii Prohonnyi
 
HTML5 & CSS3
HTML5 & CSS3 HTML5 & CSS3
HTML5 & CSS3
Ian Lintner
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
MayaLisa
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
Amit Tyagi
 
HTML with a little CSS
HTML with a little CSS HTML with a little CSS
HTML with a little CSS
Basia Madej
 
HTML5 and CSS3 Refresher
HTML5 and CSS3 RefresherHTML5 and CSS3 Refresher
HTML5 and CSS3 Refresher
Ivano Malavolta
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
Gopi A
 
Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1
Oleksii Prohonnyi
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
MayaLisa
 
Ad

Similar to (Fast) Introduction to HTML & CSS (20)

Mdst 3559-02-01-html
Mdst 3559-02-01-htmlMdst 3559-02-01-html
Mdst 3559-02-01-html
Rafael Alvarado
 
CSS Part I
CSS Part ICSS Part I
CSS Part I
Doncho Minkov
 
Css 2010
Css 2010Css 2010
Css 2010
guest0f1e7f
 
Css 2010
Css 2010Css 2010
Css 2010
Cathie101
 
Web Designing
Web DesigningWeb Designing
Web Designing
VNIT-ACM Student Chapter
 
Uta005 lecture2
Uta005 lecture2Uta005 lecture2
Uta005 lecture2
vinay arora
 
Session ii(html)
Session ii(html)Session ii(html)
Session ii(html)
Shrijan Tiwari
 
Html n CSS
Html n CSSHtml n CSS
Html n CSS
Sukrit Gupta
 
Week 2-intro-html
Week 2-intro-htmlWeek 2-intro-html
Week 2-intro-html
Shawn Calvert
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Marc Steel
 
Before start
Before startBefore start
Before start
Medhat Dawoud
 
Html & Html5 from scratch
Html & Html5 from scratchHtml & Html5 from scratch
Html & Html5 from scratch
Ahmad Al-ammar
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML Basics
Shawn Calvert
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
Tushar Rajput
 
Css introduction
Css  introductionCss  introduction
Css introduction
vishnu murthy
 
SDP_-_Module_4.ppt
SDP_-_Module_4.pptSDP_-_Module_4.ppt
SDP_-_Module_4.ppt
ssuser568d77
 
Week3 css
Week3 cssWeek3 css
Week3 css
Rowena LI
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
Hatem Mahmoud
 
Presentation html
Presentation   htmlPresentation   html
Presentation html
Billy Tierra
 
Empowerment Technologies Lecture 10 (Philippines SHS)
Empowerment Technologies Lecture 10 (Philippines SHS)Empowerment Technologies Lecture 10 (Philippines SHS)
Empowerment Technologies Lecture 10 (Philippines SHS)
John Bosco Javellana, MAEd.
 
Ad

Recently uploaded (20)

ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
Jasper Oosterveld
 
Dancing with AI - A Developer's Journey.pptx
Dancing with AI - A Developer's Journey.pptxDancing with AI - A Developer's Journey.pptx
Dancing with AI - A Developer's Journey.pptx
Elliott Richmond
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Data Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any ApplicationData Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any Application
Safe Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Improving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevExImproving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevEx
Justin Reock
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
DevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical PodcastDevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical Podcast
Chris Wahl
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
FCF- Getting Started in Cybersecurity 3.0
FCF- Getting Started in Cybersecurity 3.0FCF- Getting Started in Cybersecurity 3.0
FCF- Getting Started in Cybersecurity 3.0
RodrigoMori7
 
Jeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software DeveloperJeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software Developer
Jeremy Millul
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyesEnd-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
ThousandEyes
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf
Minuscule Technologies
 
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
Jasper Oosterveld
 
Dancing with AI - A Developer's Journey.pptx
Dancing with AI - A Developer's Journey.pptxDancing with AI - A Developer's Journey.pptx
Dancing with AI - A Developer's Journey.pptx
Elliott Richmond
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Data Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any ApplicationData Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any Application
Safe Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Improving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevExImproving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevEx
Justin Reock
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
DevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical PodcastDevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical Podcast
Chris Wahl
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
FCF- Getting Started in Cybersecurity 3.0
FCF- Getting Started in Cybersecurity 3.0FCF- Getting Started in Cybersecurity 3.0
FCF- Getting Started in Cybersecurity 3.0
RodrigoMori7
 
Jeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software DeveloperJeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software Developer
Jeremy Millul
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyesEnd-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
ThousandEyes
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf
Minuscule Technologies
 

(Fast) Introduction to HTML & CSS

  • 1. (Fast) Introduction to HTML & CSSDave Kelly ( @davkell )for @091Labs
  • 2. What are HTML & CSS?HTML structures documents on the webTells browser what content is (not what it means)CSS = presentation (how things look)JavaScript adds interaction / behavioursPeanut lifted from http://www.alistapart.com/articles/understandingprogressiveenhancement/Why separate?http://www.ambientage.com/blog/091labs : 1
  • 3. Standards.... define the mark-up you use tell the browser what to do with itHTML 4.01 (Don’t use)xHTML1.0Frameset (nope)Transitional (nope)Strict *HTML5 (New. Not fully supported / implemented. It’s the future.)All those defined standards....do all browsers work the same?
  • 4. ToolsFirefox (wide support for standards)Firebug (Firefox add-on, Chrome also, but weak). Your best friend with front-end web dev.Web Developer Toolbar (Firefox add-on)ValidatorsHTML: http://validator.w3.orgCSS: http://jigsaw.w3.orgDevelopment environmentNetbeans / Aptana for me.... Your choice (not WYSIWYG!!)(My) Development processFirefox -> Webkit (chrome / safari) -> IE8 -> IE7 -> (IE6?)Browsershots.orghttp://www.ambientage.com/blog/091labs : 2
  • 5. HTMLMade up of “tags”  (elements)<h1>I’m an important heading</h1> (Heading level 1)  <img src=”images/myprofilepic.jpg” alt=”It’s a picture of me!!” /> (Image tag)Elements can contain plain text, other elements, or bothNo state / no logic (Mark-up content only, not programming)xHTML Strict elements...must be properly nestedmust be closedmust be lower caseattributes must have a value
  • 6. HTML TagsTags are usually paired (e.g..., <h1> and </h1>) Some elements are “self-closing” e.g. <br /> <img … />Some elements may include attributes, (additional information that is included inside the start tag).Every HTML document contains standard tags. Each document consists of a head and body The head contains the title (and more…), and The body contains the actual text that is made up of paragraphs, lists, images, and other elements
  • 8. Some HTML tag examplesHeadings
  • 9. <h1></h1> , <h2> </h2> …… <h6> </h6>
  • 11. Lists
  • 12. Ordered List <ol> <li>I’m a list item</li></ol>
  • 13. Unordered list <ul> <li>I’m a list item</li> </ul>
  • 14. Document Section <div></div> (Important for page layouts!)
  • 15. Image <img src=“../images/mypic.jpg” alt=“My Picture” title=“It’s me!” />
  • 17. Table <table><tr><td>table cell</td></tr> <tr><td>second row cell</td></tr> </table>http://www.ambientage.com/blog/091labs : 4 & 5
  • 18. Some HTML attribute examplesHTML tags can have attributes => give some more info about the tag
  • 19. Most can have:<h1 id=“mainHeading” class=“myHeadingClass” title=“Website title” style=“color: #000000;”>My Heading</h1>
  • 20. HTML FormsForms are used to accept information from the Web page userForms can use text boxes, password boxes, check boxes, radio buttons, text areas, drop-down lists, hidden fields, as well as Submit and Clear buttons.To create a form, the <form></form> element is used.Forms have 2 basic attributes: action & method, e.g., <form name=“myForm” action=“processPage.php” method=“post”>action = “where’s the data going?”method = “how’s it getting there? (post vs get)”
  • 23. CSS (Cascading Style Sheets)Handles presentation of web page
  • 24. It allows document authors to specify the look of a web page (e.g. fonts, spacing, margins,etc.) separately from the structure of the web page (e.g. body, text, links, etc.)
  • 25. There are 3 ways document styles can be defined: 1. Inline (No!)2. Internal (ehhhm….no)External (Yes!)Concept of the “Cascade”
  • 26. If a duplicate style is declared, it “cascades” through various layers, each overriding the previous…The CascadeThe LayersUser agent settings (default browser styles - user is usually able to modify some of these)Any External (Linked) style sheets (.css file)Any Internal styles (in head section inside <style> tags)Inline Styles (in the style attribute of an element)Each level of style overrides the previous level where duplicate properties are definedCreating Style RulesThere are 2 pieces to each rule:
  • 27. The Selector ~ tells the rule what elements it should apply to
  • 28. The Rule ~ does the formatting of the element
  • 29. Made up of a property:value pair
  • 30. The formatting of rules: Selector { property1: value1;property2: value2; propertyN: valueN;}http://www.ambientage.com/blog/091labs : 6
  • 31. Selectors: Match by ElementEasiest selector method is to use an element name, e.g.
  • 32. p { color: #000000; }
  • 33. Doing this causes all the tags of that name (i.e.<p>) to be formatted according to the style rule declared.
  • 34. Possible to do this for multiple elements
  • 35. h1, h2, h5, p { colour: #ff0000;}Selectors: Match by ClassUsed to display elements of the same type in different ways, e.g.
  • 36. If the page you’re working with has 2 colours in its background, you need to put light text on the dark background, and dark text on the light background
  • 37. Classes are defined using a dot (.) and a given name, e.g.
  • 39. To use the class in the document:
  • 40. <p class=“lightText”>This is white text</p>Selectors: Match by IdentifierUsed to display a specific element in a different way, e.g.
  • 41. If you need an element on a page presented in a particular way, you can use an Identifier (remember an element’s id attribute is unique to a page)
  • 42. Identifiers are defined using a hash (#) and a given name, e.g.
  • 43. #siteTitle{ font-family: ‘Times New Roman’, serif}
  • 44. To use the class in the document:
  • 45. <h1 id=“siteTitle”>My Site Name</h1>Inline Style Rules…only apply to the current element…Overrides other styles if duplicates declared (because of the cascade)Maintenance nightmare
  • 46. Internal Style Rules…only apply to the current page…still slightly nightmarish to maintain
  • 47. External Style Sheets (.css)These allow you to…
  • 48. customise & alter the look of multiple web pages
  • 49. ensure continuity of design throughout the website
  • 50. To link an external style sheet to a HTML page use the <link> tag in the <head> section of the document, e.g.http://www.ambientage.com/blog/091labs : 7
  • 51. Link StylesPseudo-classes are identifiers understood by the browser to apply to a subset of elements, without the element needing to be explicitly tagged with the styleQuestions?Get in touch… [email protected]