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

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
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
 
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 businesspanagenda
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
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 DiscoveryTrustArc
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Recently uploaded (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
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
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

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.