22PLC15A - Module 1 - 2022-23
22PLC15A - Module 1 - 2022-23
OUTPUT:
First Look at HTML and XHTML
• HTML5 example
Hello HTML
<!DOCTYPE> declaration in HTML 5
HTML5 example Output:
Hello HTML and XHTML World
• In the case of XHTML, which is a form of HTML that is based upon the
syntax rules of XML,
Hello XHTML World
In the case of XHTML,
Output
Hello HTML and XHTML World
• The preceding examples use some of the most common elements
used in (X)HTML documents, including
• The <!DOCTYPE> statement, which indicates the particular
version of HTML or XHTML being used in the document.
• The <html>, <head>, and <body> tag pairs are used to specify the
general structure of the document. The required inclusion of the
xmlns attribute in the <html> tag is a small difference required by
XHTML.
• The <meta> tag used in the examples indicates the MIME(Media
type) type of the document and the character set in use. Notice
that in the XHTML example, the element has a trailing slash to
indicate that it is an empty element.
Hello HTML and XHTML World
• The <title> and </title> tag pair specifies the title of the
document, which generally appears in the title bar of the Web
browser.
• A comment is specified by <!-- -->, allowing page authors to
provide notes for future reference.
• The <h1> and </h1> header tag pair indicates a headline
specifying some important information.
• The <hr> tag, which has a self-identifying end tag (<hr />) under
XHTML, inserts a horizontal rule, or bar, across the screen.
• The <p> and </p> paragraph tag pair indicates a paragraph of
text.
Hello HTML and XHTML World
• The <em> and </em> tag pair surrounds a small piece of text to
emphasize which a browser typically renders in italics.
Viewing Markup Locally
• How do I view markup in HTML?
• Open your browser and navigate to the page for which you wish
to view the HTML.
• Right-click on the page to open the right-click menu after the
page finishes loading.
• Click the menu item that allows you to view the source. ...
• When the source page opens, you'll see the HTML code for the
full page.
Viewing Markup with a Web Server
• There are many options for employing a Web server.
• You may decide to run your own local development Web
server on your desktop system(XAMPP) or use some
hosted server instead.
• To make your files available via the server, you might use a
process of uploading a file from your system to a remote
server via an FTP (File Transfer Protocol) program, as
shown here:
Viewing Markup with a Web Server
Viewing Markup with a Web Server
• Many Web editors also allow you to synchronize files
between a local directory and your remote server. For
example, a snippet of the synchronization facility provided in
Dreamweaver is shown here:
HTML and XHTML: Version History
HTML and XHTML: Version History
HTML and XHTML: Version History
(X)HTML Document Structure
(X)HTML Document Structure
• The XHTML documents contains three parts, which are discussed
below:
• DOCTYPE: It is used to declare a DTD
• head: The head section is used to declare the title and other
attributes.
• body: The body tag contains the content of web pages. It consists
many tags.
(X)HTML Document Structure
• Creating a XHTML web page, it is necessary to include DTD
(Document Type Definition) declaration. There are three types of DTD
which are discussed below:
• Transitional DTD
• Strict DTD
• Frameset DTD
(X)HTML Document Structure
• Transitional DTD: It is supported by the older browsers which does
not have inbuilt cascading style sheets supports. There are several
attributes enclosing the body tag which are not allowed in strict DTD.
• Syntax
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
(X)HTML Document Structure
• Strict DTD: Strict DTD is used when XHTML page contains only markup
language. Strict DTD is used together with cascading style sheets, because
this attribute does not allow CSS property in body tag.
• Syntax:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
(X)HTML Document Structure
• Frameset DTD: The frameset DTD is used when XHTML page contains
frames.
• Syntax:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en“
lang="en">
Hello HTML and XHTML World
• The preceding examples use some of the most common elements
used in (X)HTML documents, including
• The <!DOCTYPE> statement, which indicates the particular
version of HTML or XHTML being used in the document.
• The <html>, <head>, and <body> tag pairs are used to specify the
general structure of the document. The required inclusion of the
xmlns attribute in the <html> tag is a small difference required by
XHTML.
• The <meta> tag used in the examples indicates the MIME(Media
type) type of the document and the character set in use. Notice
that in the XHTML example, the element has a trailing slash to
indicate that it is an empty element.
Hello HTML and XHTML World
• The <title> and </title> tag pair specifies the title of the
document, which generally appears in the title bar of the Web
browser.
• A comment is specified by <!-- -->, allowing page authors to
provide notes for future reference.
• The <h1> and </h1> header tag pair indicates a headline
specifying some important information.
• The <hr> tag, which has a self-identifying end tag (<hr />) under
XHTML, inserts a horizontal rule, or bar, across the screen.
• The <p> and </p> paragraph tag pair indicates a paragraph of
text.
Other Elements in the head
• <base> A <base> tag specifies an absolute URL address that is used to
provide server and directory information for partially specified URL
addresses, called relative links, used within the document:
• <base href="http://htmlref.com/basexeample" >
• Because of its global nature, a <base> tag is often found right after a
<title> tag
• <link> A <link> tag specifies a special relationship between the
current document and another document. Most commonly, it is used
to specify a style sheet used by the document
• <link rel="stylesheet" media="screen" href="global.css"
type="text/css" >
Other Elements in the head
• <object> An <object> tag allows programs and other binary objects to be
directly embedded in a Web page.
• <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width="0" height="0" id="HiddenFlash" > <param name="movie"
value="flashlib.swf" /></object>