SlideShare a Scribd company logo
1 of 30
Download to read offline
Side Trip: XHTML




           Using XHTML
XHTML

●   Extensible Hypertext Markup Language
●   Supposedly the replacement for HTML.
●   Reformulation of HTML in XML.
    –   Still like HTML with the rules of XML (on
        wellformedness).
Required Elements in XHTML

●   <!DOCTYPE>
    –   One of three doctypes.
●   <html>
    –   Root element
●   <head>
●   <title>
●   <body>
Differences from HTML

●   Always well-formed.
●   Some elements are required elements.
●   Some elements in HTML that are formatting, e.g.
    <b>, <i>, etc. are avoided (Even absent) in
    XHTML.
    –   Presentation rules should be defined in CSS.
●   All tags, attributes and even attribute values are in
    lowercase characters.
●   Some attributes of some elements are required
    –   OTHERWISE your XHTML document is NOT valid
The DOCTYPES

●   XHTML Transitional
    –   Compatibility with old browsers that does not support
         CSS.
●   XHTML Strict
        –   Free from presentational elements.
●   XHTML Frameset
        –   When using <frameset> & <frame>
XHTML Template

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
  transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title goes here</title>
</head>

<body>
</body>

</html>
Where It's Going

●   XHTML 1.1 : Modularized XHTML
●   XHTML 2.0 : Still In Development
    –   HTML Forms to be replaced by XForms
    –   HTML frames to be replaced by XFrames
    –   Any element can become a hyperlink
    –   Etc..
Validating XHTML Documents
Presentation of (XML) Data for the
Web
XML: Separation of Data From
Presentation
●   XML Documents are data-centric.
    –   Markup of data only.
●   XML Documents should be free from
    presentation/styling/display/formatting elements.
    –   No elements included as to how other elements should
        be formatted
    –   This would keep any XML portable and
        display-“platform” independent.
Presentation of XML Data using
Stylesheet
●   A Stylesheet
    –   A specification on how to display the data.
●   Cascading Stylesheets (CSS)
    –   Added to HTML to solve rendering consistency
        problems
    –   With CSS We can specify how to exactly display
        HTML elements.
    –   CSS can be applied to XML documents as well.
CSS: Attaching to HTML

●   External Stylesheets
    –   CSS rules written in separate file
    –   Linked via

    <link rel=”stylesheet”
          href=”styles.css”
          type=”text/css” />

    <!-- styles.css is the URL of the
         CSS file -->
CSS: Attaching to HTML

●   Internal Stylesheets
    –   Style rules written inside <style> inside <head>


    <html>
         <head>
            <style>

            //style rules here
            </style>
         </head>
    . . .
CSS: Attaching to HTML

●   Inline Style
    –   Style rules written inside in style attribute in
        presentable elements



    <p style=”font:Arial”> ... </p>
    . . .
CSS Syntax

   selector { property : value;
              property2 : value2
                 }

               Example:
    p { font-family : “sans serif” }

       p { text-align: centery;
            color : red }
Specifying Selectors

●   Element name (e.g. <p>, <a> etc... }
    a { text-decoration: none }
    //represents the <a> elements

●   Element Class (specified by class attribute)

    .reddish { color:red }
    div.reddish { background-color : red }

    Corresponds to the ff:
    <a class=”reddish”>
    <div class=”reddish”>
Specifying Selectors

●   Element ID (specified by id attribute
    #unique { border : 1px solid black }
    a#unico { display: block }

    Corresponds to
    <p id=”unique”>
    <a id=”unico”>
Specifying Selectors

●   Grouped Selector
    h1,h2,h3,h4,h5,h6,h7 {
        color: blue
    }
●   Heirarchial Selector
    p a {
        text-decoration: none;
        color red;
    }
    // applies to: <a> elems inside <p>
Specifying Selectors

●   Element with Specific Attribute


input[type=”text”] {
     border: 1px solid red
}
/* applies to <input type=”text”>
elems, IE sucks on this
dunno about IE 7 though */
Specifying Selectors

●   Pseudo-classes


a:link { color: #FFFF00 }
a:hover { color: rgb(123,234,54) }
a:visited { color: salmon }
CSS Properties and Their Values

●   Background Properties   ●   Dimension
●   Text                    ●   Classification
●   Font                    ●   Positioning
●   Border                  ●   Print (CSS2 Media)
●   Margin                  ●   Aural (CSS2 Media)
●   Padding
●   List
CSS Properties and Their Values

●   Consult a CSS Reference for the different property
    names and their possible values.
CSS Inheritance

●   Most CSS properties are inheritable from more
    general selectors to more specific selectors
●   When two properties conflict, the more specific
    rule is applied, otherwise the rules combine.
Observe:

/* CSS Rules */             <!-- HTML Markup-->

a{                          <a href=””>Link 1</a>
    font-family: “sans
      serif”;               <div>
    color:red               <a href=””>Link 2</a>
    }
                            </div>
div a {
    color:blue;
    text-decoration:none;
}
CSS Rule application:

●   Browser Default
●   External CSS
●   Internal CSS
●   Inline


In terms of selector, the rules of the most specific
  selector that applies to an element overwrites any
  less specific declarations.
XML + CSS = Web Page

●   With any XML document, we can apply CSS to
    display it as web page.
●   The selectors will be the elements of the XML
    documents.

More Related Content

What's hot

Web front end development introduction to html css and javascript
Web front end development introduction to html css and javascriptWeb front end development introduction to html css and javascript
Web front end development introduction to html css and javascriptMarc Huang
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSMario Hernandez
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksAmit Tyagi
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS PresentationShawn Calvert
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheetMichael Jhon
 
FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1Toni Kolev
 
FFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTMLFFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTMLToni Kolev
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSdanpaquette
 
FFW Gabrovo PMG - jQuery
FFW Gabrovo PMG - jQueryFFW Gabrovo PMG - jQuery
FFW Gabrovo PMG - jQueryToni Kolev
 

What's hot (20)

XML Technologies
XML TechnologiesXML Technologies
XML Technologies
 
Web front end development introduction to html css and javascript
Web front end development introduction to html css and javascriptWeb front end development introduction to html css and javascript
Web front end development introduction to html css and javascript
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Unit 3 (it workshop).pptx
Unit 3 (it workshop).pptxUnit 3 (it workshop).pptx
Unit 3 (it workshop).pptx
 
Xml
Xml Xml
Xml
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
Xsd tutorial
Xsd tutorialXsd tutorial
Xsd tutorial
 
CSS
CSSCSS
CSS
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
 
Xml
Xml Xml
Xml
 
CSS
CSSCSS
CSS
 
Css Basics
Css BasicsCss Basics
Css Basics
 
FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1
 
FFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTMLFFW Gabrovo PMG - HTML
FFW Gabrovo PMG - HTML
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
FFW Gabrovo PMG - jQuery
FFW Gabrovo PMG - jQueryFFW Gabrovo PMG - jQuery
FFW Gabrovo PMG - jQuery
 

Viewers also liked (11)

Chapter2a
Chapter2aChapter2a
Chapter2a
 
Chapter2c
Chapter2cChapter2c
Chapter2c
 
Cmsc 100 (web content)
Cmsc 100  (web content)Cmsc 100  (web content)
Cmsc 100 (web content)
 
Chapter2a
Chapter2aChapter2a
Chapter2a
 
Chapter2b
Chapter2bChapter2b
Chapter2b
 
Chapter1b
Chapter1bChapter1b
Chapter1b
 
linked list (CMSC 123)
linked list (CMSC 123)linked list (CMSC 123)
linked list (CMSC 123)
 
Chapter1c
Chapter1cChapter1c
Chapter1c
 
Cmsc 100 (web programming in a nutshell)
Cmsc 100 (web programming in a nutshell)Cmsc 100 (web programming in a nutshell)
Cmsc 100 (web programming in a nutshell)
 
Chapter2d
Chapter2dChapter2d
Chapter2d
 
Chapter1a
Chapter1aChapter1a
Chapter1a
 

Similar to Cmsc 100 xhtml and css

Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2Sónia
 
css-presentation.ppt
css-presentation.pptcss-presentation.ppt
css-presentation.pptprathur68
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssTesfaye Yenealem
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...JebaRaj26
 
An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)Ardee Aram
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptkassahungebrie
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshMukesh Kumar
 
Web Programming-css.pptx
Web Programming-css.pptxWeb Programming-css.pptx
Web Programming-css.pptxMarwaAnany1
 
ch04-css-basics_final.ppt
ch04-css-basics_final.pptch04-css-basics_final.ppt
ch04-css-basics_final.pptGmachImen
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxkarthiksmart21
 
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Gheyath M. Othman
 
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
CascadingStyleSheets  in ONESHOT By DeathCodeYT .pdfCascadingStyleSheets  in ONESHOT By DeathCodeYT .pdf
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdfbalbirnainnain496
 

Similar to Cmsc 100 xhtml and css (20)

Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
 
css-presentation.ppt
css-presentation.pptcss-presentation.ppt
css-presentation.ppt
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
 
Web technology Unit-II Part-C
Web technology Unit-II Part-CWeb technology Unit-II Part-C
Web technology Unit-II Part-C
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
 
An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).ppt
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
 
Css introduction
Css  introductionCss  introduction
Css introduction
 
Web Programming-css.pptx
Web Programming-css.pptxWeb Programming-css.pptx
Web Programming-css.pptx
 
Css
CssCss
Css
 
CSS.pdf
CSS.pdfCSS.pdf
CSS.pdf
 
ch04-css-basics_final.ppt
ch04-css-basics_final.pptch04-css-basics_final.ppt
ch04-css-basics_final.ppt
 
Css
CssCss
Css
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptx
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
 
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1
 
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
CascadingStyleSheets  in ONESHOT By DeathCodeYT .pdfCascadingStyleSheets  in ONESHOT By DeathCodeYT .pdf
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
 

Recently uploaded

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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
 
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...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Cmsc 100 xhtml and css

  • 1. Side Trip: XHTML Using XHTML
  • 2. XHTML ● Extensible Hypertext Markup Language ● Supposedly the replacement for HTML. ● Reformulation of HTML in XML. – Still like HTML with the rules of XML (on wellformedness).
  • 3. Required Elements in XHTML ● <!DOCTYPE> – One of three doctypes. ● <html> – Root element ● <head> ● <title> ● <body>
  • 4. Differences from HTML ● Always well-formed. ● Some elements are required elements. ● Some elements in HTML that are formatting, e.g. <b>, <i>, etc. are avoided (Even absent) in XHTML. – Presentation rules should be defined in CSS. ● All tags, attributes and even attribute values are in lowercase characters. ● Some attributes of some elements are required – OTHERWISE your XHTML document is NOT valid
  • 5. The DOCTYPES ● XHTML Transitional – Compatibility with old browsers that does not support CSS. ● XHTML Strict – Free from presentational elements. ● XHTML Frameset – When using <frameset> & <frame>
  • 6. XHTML Template <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title goes here</title> </head> <body> </body> </html>
  • 7. Where It's Going ● XHTML 1.1 : Modularized XHTML ● XHTML 2.0 : Still In Development – HTML Forms to be replaced by XForms – HTML frames to be replaced by XFrames – Any element can become a hyperlink – Etc..
  • 9.
  • 10.
  • 11.
  • 12. Presentation of (XML) Data for the Web
  • 13. XML: Separation of Data From Presentation ● XML Documents are data-centric. – Markup of data only. ● XML Documents should be free from presentation/styling/display/formatting elements. – No elements included as to how other elements should be formatted – This would keep any XML portable and display-“platform” independent.
  • 14. Presentation of XML Data using Stylesheet ● A Stylesheet – A specification on how to display the data. ● Cascading Stylesheets (CSS) – Added to HTML to solve rendering consistency problems – With CSS We can specify how to exactly display HTML elements. – CSS can be applied to XML documents as well.
  • 15. CSS: Attaching to HTML ● External Stylesheets – CSS rules written in separate file – Linked via <link rel=”stylesheet” href=”styles.css” type=”text/css” /> <!-- styles.css is the URL of the CSS file -->
  • 16. CSS: Attaching to HTML ● Internal Stylesheets – Style rules written inside <style> inside <head> <html> <head> <style> //style rules here </style> </head> . . .
  • 17. CSS: Attaching to HTML ● Inline Style – Style rules written inside in style attribute in presentable elements <p style=”font:Arial”> ... </p> . . .
  • 18. CSS Syntax selector { property : value; property2 : value2 } Example: p { font-family : “sans serif” } p { text-align: centery; color : red }
  • 19. Specifying Selectors ● Element name (e.g. <p>, <a> etc... } a { text-decoration: none } //represents the <a> elements ● Element Class (specified by class attribute) .reddish { color:red } div.reddish { background-color : red } Corresponds to the ff: <a class=”reddish”> <div class=”reddish”>
  • 20. Specifying Selectors ● Element ID (specified by id attribute #unique { border : 1px solid black } a#unico { display: block } Corresponds to <p id=”unique”> <a id=”unico”>
  • 21. Specifying Selectors ● Grouped Selector h1,h2,h3,h4,h5,h6,h7 { color: blue } ● Heirarchial Selector p a { text-decoration: none; color red; } // applies to: <a> elems inside <p>
  • 22. Specifying Selectors ● Element with Specific Attribute input[type=”text”] { border: 1px solid red } /* applies to <input type=”text”> elems, IE sucks on this dunno about IE 7 though */
  • 23. Specifying Selectors ● Pseudo-classes a:link { color: #FFFF00 } a:hover { color: rgb(123,234,54) } a:visited { color: salmon }
  • 24. CSS Properties and Their Values ● Background Properties ● Dimension ● Text ● Classification ● Font ● Positioning ● Border ● Print (CSS2 Media) ● Margin ● Aural (CSS2 Media) ● Padding ● List
  • 25. CSS Properties and Their Values ● Consult a CSS Reference for the different property names and their possible values.
  • 26. CSS Inheritance ● Most CSS properties are inheritable from more general selectors to more specific selectors ● When two properties conflict, the more specific rule is applied, otherwise the rules combine.
  • 27. Observe: /* CSS Rules */ <!-- HTML Markup--> a{ <a href=””>Link 1</a> font-family: “sans serif”; <div> color:red <a href=””>Link 2</a> } </div> div a { color:blue; text-decoration:none; }
  • 28.
  • 29. CSS Rule application: ● Browser Default ● External CSS ● Internal CSS ● Inline In terms of selector, the rules of the most specific selector that applies to an element overwrites any less specific declarations.
  • 30. XML + CSS = Web Page ● With any XML document, we can apply CSS to display it as web page. ● The selectors will be the elements of the XML documents.