SlideShare uma empresa Scribd logo
1 de 45
Website Fundamentals Markup Documents
Markup Documents What is HTML?
What is HTML? HTML is the language websites are written in. The letters stand for HyperText Markup Language. It might sound complicated, but it’s actually pretty easy to understand.
What is HTML? HTML has two essential features: Hypertext Universality
What is HTML? HyperText HyperText means you can create a link in a Web page that leads the visitor to any other web page or to practically anything else on the internet. It means that information on the Web can be accessed from many different directions.
What is HTML? Universality: Universality means that because HTML documents are saved as Text Only files, virtually any computer can read a Web page. It doesn’t matter if your visitors have Macintosh or Windows machines, or whether they’re on a Unix box or even a handheld device like a Palm. The Web is open to all.
Markup Documents HTML VS. XHTML: What should you use?
HTML VS. XHTML XHTML stands for eXtensible HyperText Markup Language; it is the simplicity of HTML with the power and flexibility of XML and became the perfect foundation for CSS.
HTML VS. XHTML XHTML is a great improvement over HTML. It’s stronger, more flexible, more powerful, more likely to be supported in the future, and can be expanded to fit any need. However, there are times when you just need to publish a web document without having to stress over every last quotation mark.
Markup Documents Markup: Elements, Attributes and Values
Markup XHTML is an ingenious system of including information about the content right in a text document. This information - called markup, accounting for the m in XHTML - can include formatting instructions as well as details about the relationships between parts of the document. However, because the markup itself is comprised chiefly of text, the document is practically universally accessible.
Markup XHTML has three principle types of markup: Elements Attributes Values.
Elements Elements are like little labels that identify and structure the different parts of a Web page. Some elements have one or more attributes, which further describe the purpose and content, if any, of the element. <hr /> <tdcolspan=“3”>February</td> <imgsrc=“blueflax.jpg” width=“300” />
Elements Elements can contain text and/or other elements, or they can be empty.  A non-empty element consists of an opening tag, the content, and a closing tag. <hr /> <tdcolspan=“3”>February</td> <imgsrc=“blueflax.jpg” width=“300” />
Elements An empty element looks like a combination opening and closing tag, with an initial less than sign, the element’s name followed by any attributes it may have, a space, a forward slash, and the final greater than sign. <hr /> <td colspan=“3”>February</td> <imgsrc=“blueflax.jpg” width=“300” />
Attributes and Values Attributes contain information about the data in the document, as opposed to being that data itself. Some attributes can accept any value at all, others are more limited. Perhaps the most common are those that accept enumerated or predefined values. In other words, you must select a value from a standard list of choices. <hr /> <td colspan=“3”>February</td> <imgsrc=“blueflax.jpg” width=“300” />
Attributes and Values Many attributes require a number or percentage for their value, particularly those describing size and length. A numeric value never includes units. Where units are applicable, as in the height of text or the width of an image, they are understood to be pixels. <hr /> <td colspan=“3”>February</td> <imgsrc=“blueflax.jpg” width=“300” />
Attributes and Values The attributes controlling colour can contain values that are either a colour name or a hexadecimal representation of the red, green, and blue content of the colour. Some attributes reference other files and thus must contain values in the form of a URL, or Uniform Resource Locator, a file’s unique address on the Web. <p color=“yellow”> <p color=“#FFFFFF”> <a href=“test.html”>Click Here</a> <a href=“http://www.google.com/”>Google Search</a>
Block VS. Inline An element can be block-level or inline. If it is block-level, it will always be displayed on a new line, like a new paragraph in a book. If it is inline, it will be displayed in the current line, like the next word in a paragraph. Block Level Elements <div> <p> <table> Inline Elements <span> <a>
Block VS. Inline Block-level elements are considered the bigger structural pieces of your Web page, and as such can usually contain other block-level elements, inline elements, and text.  Inline elements, in contrast, can generally only contain other inline elements and text. Block Level Elements <div> <p> <table> Inline Elements <span> <a>
Parents and Children If one element contains another, it is considered to be the parent of the enclosed, or child element. Any element contained in the child element is considered descendants of the outer, parent element. You can actually create a family tree of a Web page that both shows the hierarchical relationships between each element on the page and uniquely identifies each element. <div>   <p></p>   <p>     <a></a>   </p> </div>
Parents and Children This structure is a key feature of HTML code and facilitates adding style to the elements and applying JavaScript effects to them. <div>   <p></p>   <p>     <a></a>   </p> </div>
Parents and Children It is important to note that when elements contain other elements, each element must be properly nested and is fully contained within its parent. Whenever you use a closing tag, it should correspond to the last unclosed opening tag. In other words, first open A then open B, then close B and then close A. <div>   <p></p>   <p>     <a></a>   </p> </div>
Markup Documents CSS (Cascading style Sheets)
CSS Most word processors today include a way to make changes to text not just word by word, but throughout an entire document using styles. Styles collect all the different properties, such as font family, size, and colour that you want to apply to similar types of text - titles, headers, captions, and so on - and give these groups of properties a common name.
CSS CSS brings to the Web the same convenience for setting styles that’s available in one central location to affect the appearance of a particular XHTML tag on a single Web page or across an entire Web site. Although CSS works with XHTML, it is not XHTML.  Rather, CSS is a separate code that enhances the abilities of XHTML, by allowing you to redefine the way that existing tags display their content.
Markup Documents Types of CSS Rules
Types of CSS Rules The best thing about Cascading Style Sheets is that they are amazingly simple to set up. They don’t require plug-ins or fancy software - just text files with rules. A CSS rule specifies the XHTML to which a style or definition applies, and then defines the style, or how the selected XHTML should behave in the browser window. You can set up rules to tell a specific XHTML tag how to display its content, or you can create generic rules and then apply them to tags at your discretion.
Types of CSS Rules The three most common selectors or ways to select the XHTML to which a style applies, are: XHTML Selector Class Selector ID Selector
XHTML Selector The XHTML element’s name is used as a selector to redefine the associated XHTML tag div { ... } p { ... } a { ... }
Class Selector A class is a “free agent” that can be applied to an XHTML tag. You can name the class almost anything. Because it can be applied to multiple XHTML tag, a class is the most versatile type of selector .class .menuItem .clear
ID Selector Much like classes, IDs can be applied to any XHTML tag, but only once on a given page to a particular tag to create an object for use with a JavaScript function #ID #navigation #footer
Markup Documents The parts of a CSS rule
The Parts of a CSS Rule All CSS rules consist of a selector and a declaration block.  The declaration block, which is surrounded by curly braces, is made up of declarations, which are pairs of properties and values separated by a semicolon.
Selectors Selectors start each rule, appearing before the left curly brace The selector can be a XHTML tag selector, a class, an ID, or a combination of these selector { property: value; }
Properties Propertiesidentify the style that is being defined. There are several dozen properties, each responsible for an aspect of the page content’s behaviour and appearance. selector { property: value; }
Values Values are assigned to a property to define its nature.  A value can be a keyword such as “yes” or “no”, a number, or a percentage. The type of value used depends solely on the property to which it is assigned. selector { property: value; }
Markup Documents Where to put CSS Rules
Where to put CSS Rules You can set up rules in three places: Inline Embedded External
Inline In an XHTML tag within the body of your document, to affect a single tag in the document.  This type of rule is often referred to as an inline rule. <p style=“color: red;”>This is a paragraph displayed in red.</p>
Embedded In the head of a document, to affect a single Web page. This type of rule is called an embedded rule. <style>   p { color: red; } </style>
External In an external document that is then linked or imported into your XHTML document(s), to affect an entire Web site. This type of rule is called an external rule. # STYLESHEET: screen.css p { color: red; }
Where to put CSS Rules The position of a rule in relationship to the document and other CSS rules determines the scope of the rule’s effect on the document.
Markup Documents CSS and Markup languages
CSS and Markup Languages CSS is not XHTML; it simply means that XHTML now relies on the capabilities of CSS. The W3C’s thinking is this: Style sheets should be used to “relieve XHTML of the responsibilities of presentation.”

Mais conteúdo relacionado

Mais procurados

Html project
Html projectHtml project
Html project
arsh7511
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML Basics
Shawn Calvert
 

Mais procurados (19)

HTML Email
HTML EmailHTML Email
HTML Email
 
Html project
Html projectHtml project
Html project
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Css
CssCss
Css
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
Html
HtmlHtml
Html
 
Web Page Designing
Web Page DesigningWeb Page Designing
Web Page Designing
 
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
 
Html For Beginners 2
Html For Beginners 2Html For Beginners 2
Html For Beginners 2
 
Web designing using html
Web designing using htmlWeb designing using html
Web designing using html
 
How to Make HTML and CSS Files
How to Make HTML and CSS FilesHow to Make HTML and CSS Files
How to Make HTML and CSS Files
 
Html for Beginners
Html for BeginnersHtml for Beginners
Html for Beginners
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML Basics
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
Class13
Class13Class13
Class13
 
Html
HtmlHtml
Html
 
Html ppt
Html pptHtml ppt
Html ppt
 
Web Application and HTML Summary
Web Application and HTML SummaryWeb Application and HTML Summary
Web Application and HTML Summary
 

Destaque

The Art Of Typography
The Art Of TypographyThe Art Of Typography
The Art Of Typography
Steven Cahill
 
Purchasing Equipment
Purchasing EquipmentPurchasing Equipment
Purchasing Equipment
Steven Cahill
 
Web Server Web Site Security
Web Server Web Site SecurityWeb Server Web Site Security
Web Server Web Site Security
Steven Cahill
 
Confirm Client Requirements
Confirm Client RequirementsConfirm Client Requirements
Confirm Client Requirements
Steven Cahill
 
Introduction To Network Design
Introduction To Network DesignIntroduction To Network Design
Introduction To Network Design
Steven Cahill
 
Determining Client And Networking Requirements
Determining Client And Networking RequirementsDetermining Client And Networking Requirements
Determining Client And Networking Requirements
Steven Cahill
 
Testing Frameworks And Methodologies
Testing Frameworks And MethodologiesTesting Frameworks And Methodologies
Testing Frameworks And Methodologies
Steven Cahill
 
Introduction To Networking
Introduction To NetworkingIntroduction To Networking
Introduction To Networking
Steven Cahill
 
Planning Your Website
Planning Your WebsitePlanning Your Website
Planning Your Website
Steven Cahill
 
Networking Standards And Protocols
Networking Standards And ProtocolsNetworking Standards And Protocols
Networking Standards And Protocols
Steven Cahill
 
Network Hardware And Software
Network Hardware And SoftwareNetwork Hardware And Software
Network Hardware And Software
Steven Cahill
 
Web Standards And Protocols
Web Standards And ProtocolsWeb Standards And Protocols
Web Standards And Protocols
Steven Cahill
 
Threats To The System
Threats To The SystemThreats To The System
Threats To The System
Steven Cahill
 

Destaque (20)

Writing For The Web
Writing For The WebWriting For The Web
Writing For The Web
 
The Art Of Typography
The Art Of TypographyThe Art Of Typography
The Art Of Typography
 
Writing For The Web
Writing For The WebWriting For The Web
Writing For The Web
 
Purchasing Equipment
Purchasing EquipmentPurchasing Equipment
Purchasing Equipment
 
Writing For The Web
Writing For The WebWriting For The Web
Writing For The Web
 
Browsers
BrowsersBrowsers
Browsers
 
Web Server Web Site Security
Web Server Web Site SecurityWeb Server Web Site Security
Web Server Web Site Security
 
Confirm Client Requirements
Confirm Client RequirementsConfirm Client Requirements
Confirm Client Requirements
 
Introduction To Network Design
Introduction To Network DesignIntroduction To Network Design
Introduction To Network Design
 
Determining Client And Networking Requirements
Determining Client And Networking RequirementsDetermining Client And Networking Requirements
Determining Client And Networking Requirements
 
Testing Frameworks And Methodologies
Testing Frameworks And MethodologiesTesting Frameworks And Methodologies
Testing Frameworks And Methodologies
 
Introduction To Networking
Introduction To NetworkingIntroduction To Networking
Introduction To Networking
 
Planning Your Website
Planning Your WebsitePlanning Your Website
Planning Your Website
 
Quality Management
Quality ManagementQuality Management
Quality Management
 
Networking Standards And Protocols
Networking Standards And ProtocolsNetworking Standards And Protocols
Networking Standards And Protocols
 
Google
GoogleGoogle
Google
 
Network Hardware And Software
Network Hardware And SoftwareNetwork Hardware And Software
Network Hardware And Software
 
Disaster Recovery
Disaster RecoveryDisaster Recovery
Disaster Recovery
 
Web Standards And Protocols
Web Standards And ProtocolsWeb Standards And Protocols
Web Standards And Protocols
 
Threats To The System
Threats To The SystemThreats To The System
Threats To The System
 

Semelhante a Markup Documents

Semantically Correct And Standards Compliance Html
Semantically Correct And Standards Compliance HtmlSemantically Correct And Standards Compliance Html
Semantically Correct And Standards Compliance Html
sanjay2211
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
vikram singh
 
Meta tag presentation
Meta tag presentationMeta tag presentation
Meta tag presentation
highbaughjr
 
Frederick Highbaugh Jr Art 2830 Meta tag presentation
Frederick Highbaugh Jr Art 2830 Meta tag presentationFrederick Highbaugh Jr Art 2830 Meta tag presentation
Frederick Highbaugh Jr Art 2830 Meta tag presentation
highbaughjr
 

Semelhante a Markup Documents (20)

Class2
Class2Class2
Class2
 
Semantically Correct And Standards Compliance Html
Semantically Correct And Standards Compliance HtmlSemantically Correct And Standards Compliance Html
Semantically Correct And Standards Compliance Html
 
XHTML and CSS
XHTML and CSS XHTML and CSS
XHTML and CSS
 
Empowerment Technologies Lecture 10 (Philippines SHS)
Empowerment Technologies Lecture 10 (Philippines SHS)Empowerment Technologies Lecture 10 (Philippines SHS)
Empowerment Technologies Lecture 10 (Philippines SHS)
 
Intr To Html & Xhtml
Intr To Html & XhtmlIntr To Html & Xhtml
Intr To Html & Xhtml
 
HTML & CSS Workshop Notes
HTML & CSS Workshop NotesHTML & CSS Workshop Notes
HTML & CSS Workshop Notes
 
Html
HtmlHtml
Html
 
O9xml
O9xmlO9xml
O9xml
 
Advanced Cascading Style Sheets
Advanced Cascading Style SheetsAdvanced Cascading Style Sheets
Advanced Cascading Style Sheets
 
What is html xml and xhtml
What is html xml and xhtmlWhat is html xml and xhtml
What is html xml and xhtml
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptx
 
Introduction to HTML- Week 3- HTMLSyntax
Introduction to HTML- Week 3- HTMLSyntaxIntroduction to HTML- Week 3- HTMLSyntax
Introduction to HTML- Week 3- HTMLSyntax
 
Meta tag presentation
Meta tag presentationMeta tag presentation
Meta tag presentation
 
Frederick Highbaugh Jr Art 2830 Meta tag presentation
Frederick Highbaugh Jr Art 2830 Meta tag presentationFrederick Highbaugh Jr Art 2830 Meta tag presentation
Frederick Highbaugh Jr Art 2830 Meta tag presentation
 
INTRODUCTION TO HTML
INTRODUCTION TO HTMLINTRODUCTION TO HTML
INTRODUCTION TO HTML
 
Web Designing
Web DesigningWeb Designing
Web Designing
 
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
 
html-basic.pdf
html-basic.pdfhtml-basic.pdf
html-basic.pdf
 
Web1O1 - Intro to HTML/CSS
Web1O1 - Intro to HTML/CSSWeb1O1 - Intro to HTML/CSS
Web1O1 - Intro to HTML/CSS
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

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...
 
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
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
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...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Markup Documents

  • 3. What is HTML? HTML is the language websites are written in. The letters stand for HyperText Markup Language. It might sound complicated, but it’s actually pretty easy to understand.
  • 4. What is HTML? HTML has two essential features: Hypertext Universality
  • 5. What is HTML? HyperText HyperText means you can create a link in a Web page that leads the visitor to any other web page or to practically anything else on the internet. It means that information on the Web can be accessed from many different directions.
  • 6. What is HTML? Universality: Universality means that because HTML documents are saved as Text Only files, virtually any computer can read a Web page. It doesn’t matter if your visitors have Macintosh or Windows machines, or whether they’re on a Unix box or even a handheld device like a Palm. The Web is open to all.
  • 7. Markup Documents HTML VS. XHTML: What should you use?
  • 8. HTML VS. XHTML XHTML stands for eXtensible HyperText Markup Language; it is the simplicity of HTML with the power and flexibility of XML and became the perfect foundation for CSS.
  • 9. HTML VS. XHTML XHTML is a great improvement over HTML. It’s stronger, more flexible, more powerful, more likely to be supported in the future, and can be expanded to fit any need. However, there are times when you just need to publish a web document without having to stress over every last quotation mark.
  • 10. Markup Documents Markup: Elements, Attributes and Values
  • 11. Markup XHTML is an ingenious system of including information about the content right in a text document. This information - called markup, accounting for the m in XHTML - can include formatting instructions as well as details about the relationships between parts of the document. However, because the markup itself is comprised chiefly of text, the document is practically universally accessible.
  • 12. Markup XHTML has three principle types of markup: Elements Attributes Values.
  • 13. Elements Elements are like little labels that identify and structure the different parts of a Web page. Some elements have one or more attributes, which further describe the purpose and content, if any, of the element. <hr /> <tdcolspan=“3”>February</td> <imgsrc=“blueflax.jpg” width=“300” />
  • 14. Elements Elements can contain text and/or other elements, or they can be empty. A non-empty element consists of an opening tag, the content, and a closing tag. <hr /> <tdcolspan=“3”>February</td> <imgsrc=“blueflax.jpg” width=“300” />
  • 15. Elements An empty element looks like a combination opening and closing tag, with an initial less than sign, the element’s name followed by any attributes it may have, a space, a forward slash, and the final greater than sign. <hr /> <td colspan=“3”>February</td> <imgsrc=“blueflax.jpg” width=“300” />
  • 16. Attributes and Values Attributes contain information about the data in the document, as opposed to being that data itself. Some attributes can accept any value at all, others are more limited. Perhaps the most common are those that accept enumerated or predefined values. In other words, you must select a value from a standard list of choices. <hr /> <td colspan=“3”>February</td> <imgsrc=“blueflax.jpg” width=“300” />
  • 17. Attributes and Values Many attributes require a number or percentage for their value, particularly those describing size and length. A numeric value never includes units. Where units are applicable, as in the height of text or the width of an image, they are understood to be pixels. <hr /> <td colspan=“3”>February</td> <imgsrc=“blueflax.jpg” width=“300” />
  • 18. Attributes and Values The attributes controlling colour can contain values that are either a colour name or a hexadecimal representation of the red, green, and blue content of the colour. Some attributes reference other files and thus must contain values in the form of a URL, or Uniform Resource Locator, a file’s unique address on the Web. <p color=“yellow”> <p color=“#FFFFFF”> <a href=“test.html”>Click Here</a> <a href=“http://www.google.com/”>Google Search</a>
  • 19. Block VS. Inline An element can be block-level or inline. If it is block-level, it will always be displayed on a new line, like a new paragraph in a book. If it is inline, it will be displayed in the current line, like the next word in a paragraph. Block Level Elements <div> <p> <table> Inline Elements <span> <a>
  • 20. Block VS. Inline Block-level elements are considered the bigger structural pieces of your Web page, and as such can usually contain other block-level elements, inline elements, and text. Inline elements, in contrast, can generally only contain other inline elements and text. Block Level Elements <div> <p> <table> Inline Elements <span> <a>
  • 21. Parents and Children If one element contains another, it is considered to be the parent of the enclosed, or child element. Any element contained in the child element is considered descendants of the outer, parent element. You can actually create a family tree of a Web page that both shows the hierarchical relationships between each element on the page and uniquely identifies each element. <div> <p></p> <p> <a></a> </p> </div>
  • 22. Parents and Children This structure is a key feature of HTML code and facilitates adding style to the elements and applying JavaScript effects to them. <div> <p></p> <p> <a></a> </p> </div>
  • 23. Parents and Children It is important to note that when elements contain other elements, each element must be properly nested and is fully contained within its parent. Whenever you use a closing tag, it should correspond to the last unclosed opening tag. In other words, first open A then open B, then close B and then close A. <div> <p></p> <p> <a></a> </p> </div>
  • 24. Markup Documents CSS (Cascading style Sheets)
  • 25. CSS Most word processors today include a way to make changes to text not just word by word, but throughout an entire document using styles. Styles collect all the different properties, such as font family, size, and colour that you want to apply to similar types of text - titles, headers, captions, and so on - and give these groups of properties a common name.
  • 26. CSS CSS brings to the Web the same convenience for setting styles that’s available in one central location to affect the appearance of a particular XHTML tag on a single Web page or across an entire Web site. Although CSS works with XHTML, it is not XHTML. Rather, CSS is a separate code that enhances the abilities of XHTML, by allowing you to redefine the way that existing tags display their content.
  • 27. Markup Documents Types of CSS Rules
  • 28. Types of CSS Rules The best thing about Cascading Style Sheets is that they are amazingly simple to set up. They don’t require plug-ins or fancy software - just text files with rules. A CSS rule specifies the XHTML to which a style or definition applies, and then defines the style, or how the selected XHTML should behave in the browser window. You can set up rules to tell a specific XHTML tag how to display its content, or you can create generic rules and then apply them to tags at your discretion.
  • 29. Types of CSS Rules The three most common selectors or ways to select the XHTML to which a style applies, are: XHTML Selector Class Selector ID Selector
  • 30. XHTML Selector The XHTML element’s name is used as a selector to redefine the associated XHTML tag div { ... } p { ... } a { ... }
  • 31. Class Selector A class is a “free agent” that can be applied to an XHTML tag. You can name the class almost anything. Because it can be applied to multiple XHTML tag, a class is the most versatile type of selector .class .menuItem .clear
  • 32. ID Selector Much like classes, IDs can be applied to any XHTML tag, but only once on a given page to a particular tag to create an object for use with a JavaScript function #ID #navigation #footer
  • 33. Markup Documents The parts of a CSS rule
  • 34. The Parts of a CSS Rule All CSS rules consist of a selector and a declaration block. The declaration block, which is surrounded by curly braces, is made up of declarations, which are pairs of properties and values separated by a semicolon.
  • 35. Selectors Selectors start each rule, appearing before the left curly brace The selector can be a XHTML tag selector, a class, an ID, or a combination of these selector { property: value; }
  • 36. Properties Propertiesidentify the style that is being defined. There are several dozen properties, each responsible for an aspect of the page content’s behaviour and appearance. selector { property: value; }
  • 37. Values Values are assigned to a property to define its nature. A value can be a keyword such as “yes” or “no”, a number, or a percentage. The type of value used depends solely on the property to which it is assigned. selector { property: value; }
  • 38. Markup Documents Where to put CSS Rules
  • 39. Where to put CSS Rules You can set up rules in three places: Inline Embedded External
  • 40. Inline In an XHTML tag within the body of your document, to affect a single tag in the document. This type of rule is often referred to as an inline rule. <p style=“color: red;”>This is a paragraph displayed in red.</p>
  • 41. Embedded In the head of a document, to affect a single Web page. This type of rule is called an embedded rule. <style> p { color: red; } </style>
  • 42. External In an external document that is then linked or imported into your XHTML document(s), to affect an entire Web site. This type of rule is called an external rule. # STYLESHEET: screen.css p { color: red; }
  • 43. Where to put CSS Rules The position of a rule in relationship to the document and other CSS rules determines the scope of the rule’s effect on the document.
  • 44. Markup Documents CSS and Markup languages
  • 45. CSS and Markup Languages CSS is not XHTML; it simply means that XHTML now relies on the capabilities of CSS. The W3C’s thinking is this: Style sheets should be used to “relieve XHTML of the responsibilities of presentation.”