SlideShare a Scribd company logo
HTML
Basic HTML
 hypertext
 tags & elements
 text formatting
 lists, hyperlinks, images
 tables, frames
Hypertext & HTML
• HyperText Markup Language (HTML) is the language for specifying the static
content of Web pages (based on SGML, the Standard Generalized Markup
Language)
 hypertext refers to the fact that Web pages are more than just text
can contain multimedia, provide links for jumping within the same document &
to other documents
 markup refers to the fact that it works by augmenting text with special symbols (tags) that
identify the document structure and content type
Hypertext & HTML (cont.)
• HTML is an evolving standard (as new technology/tools are added)
 HTML 1 (Berners-Lee, 1989): very basic, limited integration of multimedia
in 1993, Mosaic added many new features (e.g., integrated images)
 HTML 2.0 (IETF, 1994): tried to standardize these & other features, but late
in 1994-96, Netscape & IE added many new, divergent features
 HTML 3.2 (W3C, 1996): attempted to unify into a single standard
but didn't address newer technologies like Java applets & streaming video
 HTML 4.0 (W3C, 1997): current standard (but moving towards XHTML)
attempted to map out future directions for HTML, not just react to vendors
 XHTML 1.0 (W3C, 2000): HTML 4.01 modified to conform to XML standards
 XHTML 1.1 (W3C, 2001): “Modularization” of XHTML 1.0
 HTML 5 (Web Hypertext Application Technology Working Group, W3C, 2006): New
version of HTML4, XHTML 1.0, and DOM 2 (still a work in progress), no longer
based on SGML, but “backward compatible” with parsing of older versions of
HTML. HTML 5 is referred to as a "living language".
Web Development Tools
• many high-level tools exist for creating Web pages
e.g., Microsoft FrontPage, Netscape Composer, Adobe PageMill,
Macromedia DreamWeaver, HotDog, …
also, many applications have "save to HTML" options (e.g., Word)
Don’t use these tools!!
for most users who want to develop basic, static Web pages, these are fine (but many of these
programs produce very poorly structured HTML code)
 may want low-level control
 may care about size/readability of pages
 may want to “borrow" components from other pages and integrate into existing pages
 may want dynamic features such as scripts or applets
 remote editing of web pages may only be possible using a basic text editor
 sticking to (internationally and industrially) agreed upon standards will help ensure
your web documents are rendered as you intend them to look and operate as you
desire
• why are we learning low-level HTML using a basic text editor?
Tags and Elements
• HTML specifies a set of tags that identify structure of the document and the
content type
 tags are enclosed in < >
<img src="image.gif" /> specifies an image
 most tags come in pairs, marking a beginning and ending
<title> and </title> enclose the title of a page
• an HTML element is an object enclosed by a pair (in most cases) of tags
<title>My Home Page</title> is a TITLE element
<b>This text appears bold.</b> is a BOLD element
<p>Part of this text is <b>bold</b>. </p>
is a PARAGRAPH element that contains a BOLD element
An HTML document is a collection of elements (text/media with context).
Structural Elements
• a standard HTML document has two main structural elements
 head contains setup information for the browser & the Web page
e.g., the title for the browser window, style definitions, JavaScript code, …
 body contains the actual content to be displayed in the Web page
<html>
<!–- Version information --
-- File: page01.html --
-- Author: UTA005 --
-- Creation: 13.01.15 --
-- Description: introductory page --
-- Copyright: Thapar University --
-->
<head>
<title>My first HTML document</title>
</head>
<body>
<p> Hello world! </p>
</body>
</html>
HTML documents begin and end with
<html> and </html> tags
Comments appear between <!-- and -->
head section enclosed between <head>
and </head> tags
body section enclosed between <body>
and </body>
* Find more info on HTML docs!
view page
 The <head> element is where you include a <title> element (that appears in
the title bar of the browser).
You can also include lots of other type of information in the <head> element.
o Cascading Style sheet information, or a link to an external style sheet (or several)
o “Meta” data, such as who authored the page, the type of content, and clues that
search engines may (or may not) use to help categorize your page
o JavaScript code
The <body> element contains the main bulk of the material to be displayed on
the webpage.
o Paragraphs
o Tables and lists
o Images
o JavaScript code
o PHP code can be included here too (if passed through a PHP parser before being
served to the client’s browser)
o Other embedded objects (videos, etc)
<head> and <body> elements
Text Layout
for the most part, layout of the text
is left to the browser
 (almost) every sequence of
whitespace is interpreted as a single
space
 browser automatically wraps the text to
fit the window size
can override some text layout
 can specify a new paragraph (starts on
a new line, preceded by a blank line)
using <p>…</p>
 can cause a line break using the <br/>
tag (“self-closing” tag)
 can force a space character using the
symbol for a “non-breaking space”:
&nbsp;
<html>
<!–- UTA005 page2.html 13.01.15 -->
<head>
<title>Text Layout</title>
</head>
<body>
<p>
This is a paragraph of text<br/>
made up of two lines.
</p>
<p>
This is another paragraph with a
&nbsp; GAP &nbsp; between
some of the words.
</p>
<p>
&nbsp;&nbsp; This paragraph is<br/>
indented on the first line<br/>
but not on subsequent lines.
</p>
</body>
</html>
view page
Separating Blocks of Text
can specify headings for
paragraphs or blocks of text
 <h1>…</h1> tags produce a large,
bold heading
 <h2>…</h2> tags produce a slightly
smaller heading
. . .
 <h6>…</h6> tags produce a tiny
heading
can insert a horizontal rule to divide
sections
 <hr/> (or use <hr>) draws line
across window
<html>
<!–- UTA005 page3.html 13/01/15 -->
<head>
<title>Blocks of Text</title>
</head>
<body>
<h1>Major heading 1</h1>
<p>
Here is some text.
</p>
<h2>Subheading</h2>
<p>
Here is some subtext.
</p>
<hr/>
<h1>Major heading 2</h1>
<p>
Here is some more text.
</p>
</body>
</html>
view page
The Basic Web page – A Worked Example
<html>
<!–- UTA005 page22.html 13.01.15 -->
<head>
<title> Computer Science & Engineering Department </title>
</head>
<body>
<h1>Computer Science & Engineering Department</h1>
<h2>Mission</h2>
<p> To provide the state of art infrastructure
and professional environment that enables
students and staff to make significant contribution
in Computer Science and Engineering. </p>
<hr/>
<h2> Vision </h2>
<p> To be recognized as a leader committed to excellence
in Computer Science and Engineering education,
research and innovation.</p>
<hr/>
</body>
</html>
view page
Text Appearance
can specify styles for fonts
 <b>… </b> specify bold
 <i>… </i> specify italics
 <tt>… </tt> specify typewriter-
like (fixed-width) font
 <small>… </small> decreases
the size of the font
 <em>…</em> puts emphasis
 <strong>…</strong> puts
even more emphasis
 <sub>… </sub> specify a
subscript
 <sup>… </sup> a superscript
 <pre>…</pre> include ready-
formatted text
 &amp; &al; &gt; &quot; &copy;
escape characters used in HTML
control
• Find more info on text tags!
<html>
<!–- UTA005 page25.html 13.01.15 -->
<head>
<title>Text Variations and Escape
Sequences</title>
</head>
<body>
<h1>Text Variations</h1>
<p>We can use <b>simple</b> tags to
<i>change</i> the appearance of
<strong>text</strong> within
<tt>Web pages</tt>.
Even super<sup>script</sup>
and sub<sub>scripts</sub> are
<em>supported</em>.</p>
<h1>Text Escape Sequences</h1>
<p>
&amp; &lt; &gt; &quot; &copy;
</p>
<h1>Preformatted text</h1>
<pre>
Thapar University
Department of Computer Science
Patiala,Punjab,India
</pre>
</body>
</html>
view page
Lists
there are 3 different types
of list elements
 <ol>…</ol> specifies an
ordered list (using numbers
or letters to label each list
item)
<li> identifies each list item
can set type of ordering, start
index
 <ul>…</ul> specifies
unordered list (using a
bullet for each)
<li> identifies each list item
 <dl>…</dl> specifies a
definition list <dt> identifies
each term
<dd> identifies its definition
* We will learn more about the
“style” attributes soon enough.
<html>
<!–- UTA005 page7.html 13.01.15 -->
<head> <title>(Sort of) Simple Lists</title>
<style type="text/css">
.my_li:before { content: counter(list) ": ";
counter-increment: list; }
</style> </head>
<body>
<ul style="list-style-type: square;">
<li> ... first list item... </li>
<li> ... second list item... ... </li>
</ul>
<dl> <dt> Dweeb </dt>
<dd> young excitable person who may
mature into a <em>Nerd</em> </dd>
<dt> Hacker </dt>
<dd> a clever programmer </dd>
<dt> Nerd </dt> <dd> technically bright but
socially inept person </dd>
</dl>
<ol style="list-style-type: none;
counter-reset: list 29;" >
<li class="my_li">Makes first item number 30.</li>
<li class="my_li">Next item continues to number
31.</li>
</ol>
</body>
</html> view page
Hyperlinks
perhaps the most important
HTML element is the hyperlink,
or ANCHOR
 <a href="URL">…</a>
where URL is the Web address of the
page to be displayed when the user
clicks on the link
if the page is accessed over the Web,
must start with http://
if not there, the browser will assume it
is the name of a local file
 <a href="URL"
target="_blank">…</a>
causes the page to be loaded in a
new
Window
* Find more info on attribute TARGET
<html>
<!–- UTA005 page8.html 13.01.15 -->
<head>
<title>Hyperlinks</title>
</head>
<body>
<p>
<a href="http://www.thapar.edu">
Thapar University</a>
<br/>
<a href="page7.html" target="_blank">
Open page07 in a new window</a>
</p>
</body>
</html>
view page
Hyperlinks (cont.)
for long documents, you can even
have links to other locations in that
same document
 <xxxx id="ident">…</xxxx>
where ident is a variable for identifying
this location, where "xxxx" can, in
principle, be any HTML element
(this is actually an HTML5 language
specification, but seems to work in most
browsers)
 <a href="#ident">…</a>
will then jump to that location within the
file
 <a href="URL#ident">…</a>
can jump into the middle of another file
just as easily
<html>
<!–- UTA005 page9.html 14.01.15 -->
<head>
<title>Internal Links in a Page</title>
</head>
<body>
<p>
[ <a href="#HTML">HTML</a> |
<a href="#HTTP">HTTP</a> |
<a href="#IP">IP</a> |
<a href="#TCP">TCP</a> ]
</p>
<p>
Computer acronyms:
<dl>
<dt id="HTML">HTML</dt>
<dd>HyperText Markup Language
<dt id="HTTP">HTTP</dt>
<dd>HyperText Transfer Protocol…</dd>
<dt id="IP">IP</dt>
<dd>Internet Protocol…</dd>
<dt id="TCP">TCP</dt>
<dd>Transfer Control Protocol…</dd>
</dl>
</p>
</body>
</html>
view page
Images
can include images using img
 by default, browsers can display GIF and JPEG files, more modern browsers can also
typically support PNG files and SVG graphics (of course, use at your own risk)
 other image formats may require plug-in applications for display
<img src="URL (or filename)" height="n" width="n" alt="text"
title= "text" />
again, if file is to be accessed over the Web, must start with http:// (if not, will assume local file)
* Find more info on <img />
<html>
<!–- UTA005 page10.html 14.01.15 -->
<head>
<title>Image example</title>
</head>
<body>
<img src="C:UserskDesktoputa005htmlcomputer.gif"
title=“Computer Science Department"
alt="image of Computer Science Department " width="400" />
<p>The Computer Science Department </p> </body>
</html>
view page
 src - specifies the file name (and can include a URL)
 width and/or height - dimensions in pixels (often only need to specify one of them
and the other is automatically scaled to match, where possible pictures should be
resized using other programs to save on bandwidth and problems that some (older)
browsers might have with resizing images)
 title - displayed when the mouse is “hovered” over the picture
 alt - text that is displayed when the image is missing, can’t be loaded (e.g. if file
permissions aren’t set correctly), or if the client has disabled loading images in his/her
browser
Images (cont.)
Tables
• tables are a common method for displaying data and other information
 a table divides contents into rows and columns
 by default, column entries are left-justified, so you must provide for your own alignment when
needed (using Cascading Style Sheets, for example)
<html>
<!–- UTA005 page11.html 14.01.15 -->
<head>
<title>Tables</title>
</head>
<body>
<h2>A Simple Table</h2>
<table>
<tr>
<td> Left Column </td>
<td> Right Column </td>
</tr>
<tr>
<td> Some data </td>
<td> Some other data </td>
</tr>
</table>
</body>
</html>
<table>…</table> specify a table
element
<tr>…</tr> specify a row in the table
<td>…</td> specify table data (i.e., each
column entry in the table)
view page
Layout in a Table
can have a border on tables using
the “style” attribute
<table style= "border: 1px solid;">
increasing the number makes the border thicker
can control the horizontal & vertical
layout within cells
<td style= "text-align:center">
<td style= "vertical-align:
bottom">
can apply layout to an entire row
<tr style="text-align: center">
<tr style="vertical-align: top">
We will explore this more with
Cascading Style Sheets (CSS).
<html>
<!– UTA005 page12.html 14.01.15 -->
<head>
<title>Table Layout</title>
</head>
<body>
<table style="border: 1px solid;">
<tr style="text-align: center;">
<td style="border: 1px solid;">
Left<br/>Column</td>
<td style="border: 1px solid;
vertical-align: top;">
Right Column</td>
</tr>
<tr>
<td style="border: 1px solid;">
Some data</td>
<td style="border: 1px solid;">
Some data</td>
</tr>
</table>
</body>
</html>
view page
Table Width
by default, the table is sized to fit
the data
can override & specify the width of
a table relative to the page
For example
<table style="width: 60%">
<html>
<!– UTA005 page13.html 14.01.15 -->
<head>
<title>Table Width</title>
</head>
<body>
<table style="width: 100%;">
<tr>
<td>left-most </td>
<td style="text-align: right;">
right-most</td>
</tr>
</table>
</body>
</html>
view page
Other Table Attributes
can control the space between cells &
margins within cells
This is the “padding” attribute in the table
and
th,td style sheet declarations
(more on this with Cascading Style
Sheets).
can add headings
<th> is similar to <td> but
displays heading centered in bold
can have data that spans more than
one column
<td colspan="2">
similarly, can span more than one row
<td rowspan="2">
(This example uses CSS style sheet
commands in the page
<header>.)
<html>
<!– UTA005 page14.html 14.01.15 -->
<head>
<title>Table Formatting</title>
<style type="text/css" media="screen">
table { border: 1px solid; padding: 1px;}
th, td { border: 1px solid; padding: 10px;
text-align: center; }
</style>
</head>
<body>
<table>
<tr>
<th>HEAD1</th> <th>HEAD2</th> <th>HEAD3</th>
</tr>
<tr>
<td>one</td> <td>two</td> <td>three</td>
</tr>
<tr>
<td rowspan="2"> four </td>
<td colspan="2"> five </td>
</tr>
<tr>
<td> six </td> <td> seven </td>
</tr>
</table>
</body>
</html>
view page

More Related Content

What's hot

Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5Vlad Posea
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
Tushar Rajput
 
HTML practical guide for O/L exam
HTML practical guide for O/L examHTML practical guide for O/L exam
HTML practical guide for O/L exam
Anne Perera
 
Html basic
Html basicHtml basic
Html basic
Viccky Khairnar
 
HTML
HTMLHTML
Usability and accessibility on the web
Usability and accessibility on the webUsability and accessibility on the web
Usability and accessibility on the webVlad Posea
 
HTML
HTMLHTML
Hf html-cheat-sheet
Hf html-cheat-sheetHf html-cheat-sheet
Hf html-cheat-sheet
HARUN PEHLIVAN
 
Html.docx
Html.docxHtml.docx
Html.docx
Noman Ali
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
Hameda Hurmat
 
Html basics
Html basicsHtml basics
Html basics
mcatahir947
 
HTML by Telerik Akademy
HTML by Telerik AkademyHTML by Telerik Akademy
HTML by Telerik AkademyOgnyan Penkov
 
Web development using html 5
Web development using html 5Web development using html 5
Web development using html 5
Anjan Mahanta
 
HTML | Computer Science
HTML | Computer ScienceHTML | Computer Science
HTML | Computer Science
Transweb Global Inc
 

What's hot (19)

Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
WWW and HTTP
WWW and HTTPWWW and HTTP
WWW and HTTP
 
CSS
CSSCSS
CSS
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
 
HTML practical guide for O/L exam
HTML practical guide for O/L examHTML practical guide for O/L exam
HTML practical guide for O/L exam
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
Html basic
Html basicHtml basic
Html basic
 
HTML
HTMLHTML
HTML
 
Usability and accessibility on the web
Usability and accessibility on the webUsability and accessibility on the web
Usability and accessibility on the web
 
Tags in html
Tags in htmlTags in html
Tags in html
 
HTML
HTMLHTML
HTML
 
Html
HtmlHtml
Html
 
Hf html-cheat-sheet
Hf html-cheat-sheetHf html-cheat-sheet
Hf html-cheat-sheet
 
Html.docx
Html.docxHtml.docx
Html.docx
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Html basics
Html basicsHtml basics
Html basics
 
HTML by Telerik Akademy
HTML by Telerik AkademyHTML by Telerik Akademy
HTML by Telerik Akademy
 
Web development using html 5
Web development using html 5Web development using html 5
Web development using html 5
 
HTML | Computer Science
HTML | Computer ScienceHTML | Computer Science
HTML | Computer Science
 

Viewers also liked

Process Synchronization
Process SynchronizationProcess Synchronization
Process Synchronizationvinay arora
 
Security & Protection
Security & ProtectionSecurity & Protection
Security & Protectionvinay arora
 
4 java - decision
4  java - decision4  java - decision
4 java - decision
vinay arora
 
Uta005 lecture1
Uta005 lecture1Uta005 lecture1
Uta005 lecture1
vinay arora
 
2 java - operators
2  java - operators2  java - operators
2 java - operators
vinay arora
 
1 java - data type
1  java - data type1  java - data type
1 java - data type
vinay arora
 
6 java - loop
6  java - loop6  java - loop
6 java - loop
vinay arora
 
CG - Introduction to Computer Graphics
CG - Introduction to Computer GraphicsCG - Introduction to Computer Graphics
CG - Introduction to Computer Graphicsvinay arora
 
Search engine and web crawler
Search engine and web crawlerSearch engine and web crawler
Search engine and web crawler
vinay arora
 
CG - Input Output Devices
CG - Input Output DevicesCG - Input Output Devices
CG - Input Output Devicesvinay arora
 
CG - Output Primitives
CG - Output PrimitivesCG - Output Primitives
CG - Output Primitivesvinay arora
 
3 java - variable type
3  java - variable type3  java - variable type
3 java - variable type
vinay arora
 

Viewers also liked (12)

Process Synchronization
Process SynchronizationProcess Synchronization
Process Synchronization
 
Security & Protection
Security & ProtectionSecurity & Protection
Security & Protection
 
4 java - decision
4  java - decision4  java - decision
4 java - decision
 
Uta005 lecture1
Uta005 lecture1Uta005 lecture1
Uta005 lecture1
 
2 java - operators
2  java - operators2  java - operators
2 java - operators
 
1 java - data type
1  java - data type1  java - data type
1 java - data type
 
6 java - loop
6  java - loop6  java - loop
6 java - loop
 
CG - Introduction to Computer Graphics
CG - Introduction to Computer GraphicsCG - Introduction to Computer Graphics
CG - Introduction to Computer Graphics
 
Search engine and web crawler
Search engine and web crawlerSearch engine and web crawler
Search engine and web crawler
 
CG - Input Output Devices
CG - Input Output DevicesCG - Input Output Devices
CG - Input Output Devices
 
CG - Output Primitives
CG - Output PrimitivesCG - Output Primitives
CG - Output Primitives
 
3 java - variable type
3  java - variable type3  java - variable type
3 java - variable type
 

Similar to Uta005 lecture2

HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
eceklu
 
HTML (Basic to Advance)
HTML (Basic to Advance)HTML (Basic to Advance)
HTML (Basic to Advance)
Coder Tech
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
vaseemshaik21
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshop
vardanyan99
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML BasicsShawn Calvert
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
xu fag
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
Minea Chem
 
Eye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easilyEye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easily
shabab shihan
 
3 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp023 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp02
Aditya Varma
 
HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.
Beqa Chacha
 
Html
HtmlHtml
Html tags
Html tagsHtml tags
Html tags
Noble Anshu
 
Html
HtmlHtml
INTRODUCTION FOR HTML
INTRODUCTION  FOR HTML INTRODUCTION  FOR HTML
INTRODUCTION FOR HTML
Rahul Bathri
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptx
VaibhavSingh887876
 
Additional HTML
Additional HTML Additional HTML
Additional HTML
Doeun KOCH
 
Advance HTML
Advance HTMLAdvance HTML
Advance HTML
VijaySingh790398
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you need
Dipen Parmar
 

Similar to Uta005 lecture2 (20)

HTML/HTML5
HTML/HTML5HTML/HTML5
HTML/HTML5
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
HTML (Basic to Advance)
HTML (Basic to Advance)HTML (Basic to Advance)
HTML (Basic to Advance)
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshop
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML Basics
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
Eye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easilyEye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easily
 
3 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp023 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp02
 
HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.
 
Html
HtmlHtml
Html
 
Html tags
Html tagsHtml tags
Html tags
 
Html
HtmlHtml
Html
 
INTRODUCTION FOR HTML
INTRODUCTION  FOR HTML INTRODUCTION  FOR HTML
INTRODUCTION FOR HTML
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptx
 
Html
HtmlHtml
Html
 
Additional HTML
Additional HTML Additional HTML
Additional HTML
 
Advance HTML
Advance HTMLAdvance HTML
Advance HTML
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you need
 

More from vinay arora

Use case diagram (airport)
Use case diagram (airport)Use case diagram (airport)
Use case diagram (airport)
vinay arora
 
Use case diagram
Use case diagramUse case diagram
Use case diagram
vinay arora
 
Lab exercise questions (AD & CD)
Lab exercise questions (AD & CD)Lab exercise questions (AD & CD)
Lab exercise questions (AD & CD)
vinay arora
 
SEM - UML (1st case study)
SEM - UML (1st case study)SEM - UML (1st case study)
SEM - UML (1st case study)
vinay arora
 
Uta005 lecture3
Uta005 lecture3Uta005 lecture3
Uta005 lecture3
vinay arora
 
CG - Display Devices
CG - Display DevicesCG - Display Devices
CG - Display Devicesvinay arora
 
C Prog. - Strings (Updated)
C Prog. - Strings (Updated)C Prog. - Strings (Updated)
C Prog. - Strings (Updated)vinay arora
 
C Prog. - Structures
C Prog. - StructuresC Prog. - Structures
C Prog. - Structuresvinay arora
 
A&D - Object Oriented Design using UML
A&D - Object Oriented Design using UMLA&D - Object Oriented Design using UML
A&D - Object Oriented Design using UMLvinay arora
 
C Prog - Strings
C Prog - StringsC Prog - Strings
C Prog - Stringsvinay arora
 
C Prog - Pointers
C Prog - PointersC Prog - Pointers
C Prog - Pointersvinay arora
 
A&D - Input Design
A&D - Input DesignA&D - Input Design
A&D - Input Designvinay arora
 
A&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UMLA&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UMLvinay arora
 
A&D - Use Case Diagram
A&D - Use Case DiagramA&D - Use Case Diagram
A&D - Use Case Diagramvinay arora
 

More from vinay arora (18)

Use case diagram (airport)
Use case diagram (airport)Use case diagram (airport)
Use case diagram (airport)
 
Use case diagram
Use case diagramUse case diagram
Use case diagram
 
Lab exercise questions (AD & CD)
Lab exercise questions (AD & CD)Lab exercise questions (AD & CD)
Lab exercise questions (AD & CD)
 
SEM - UML (1st case study)
SEM - UML (1st case study)SEM - UML (1st case study)
SEM - UML (1st case study)
 
Uta005 lecture3
Uta005 lecture3Uta005 lecture3
Uta005 lecture3
 
CG - Display Devices
CG - Display DevicesCG - Display Devices
CG - Display Devices
 
C Prog. - Strings (Updated)
C Prog. - Strings (Updated)C Prog. - Strings (Updated)
C Prog. - Strings (Updated)
 
C Prog. - Structures
C Prog. - StructuresC Prog. - Structures
C Prog. - Structures
 
A&D - UML
A&D - UMLA&D - UML
A&D - UML
 
A&D - Object Oriented Design using UML
A&D - Object Oriented Design using UMLA&D - Object Oriented Design using UML
A&D - Object Oriented Design using UML
 
C Prog - Strings
C Prog - StringsC Prog - Strings
C Prog - Strings
 
C Prog - Pointers
C Prog - PointersC Prog - Pointers
C Prog - Pointers
 
C Prog - Array
C Prog - ArrayC Prog - Array
C Prog - Array
 
C Prog - Array
C Prog - ArrayC Prog - Array
C Prog - Array
 
A&D - Input Design
A&D - Input DesignA&D - Input Design
A&D - Input Design
 
A&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UMLA&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UML
 
A&D - Use Case Diagram
A&D - Use Case DiagramA&D - Use Case Diagram
A&D - Use Case Diagram
 
A&D - Output
A&D - OutputA&D - Output
A&D - Output
 

Recently uploaded

Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 

Recently uploaded (20)

Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 

Uta005 lecture2

  • 1. HTML Basic HTML  hypertext  tags & elements  text formatting  lists, hyperlinks, images  tables, frames
  • 2. Hypertext & HTML • HyperText Markup Language (HTML) is the language for specifying the static content of Web pages (based on SGML, the Standard Generalized Markup Language)  hypertext refers to the fact that Web pages are more than just text can contain multimedia, provide links for jumping within the same document & to other documents  markup refers to the fact that it works by augmenting text with special symbols (tags) that identify the document structure and content type
  • 3. Hypertext & HTML (cont.) • HTML is an evolving standard (as new technology/tools are added)  HTML 1 (Berners-Lee, 1989): very basic, limited integration of multimedia in 1993, Mosaic added many new features (e.g., integrated images)  HTML 2.0 (IETF, 1994): tried to standardize these & other features, but late in 1994-96, Netscape & IE added many new, divergent features  HTML 3.2 (W3C, 1996): attempted to unify into a single standard but didn't address newer technologies like Java applets & streaming video  HTML 4.0 (W3C, 1997): current standard (but moving towards XHTML) attempted to map out future directions for HTML, not just react to vendors  XHTML 1.0 (W3C, 2000): HTML 4.01 modified to conform to XML standards  XHTML 1.1 (W3C, 2001): “Modularization” of XHTML 1.0  HTML 5 (Web Hypertext Application Technology Working Group, W3C, 2006): New version of HTML4, XHTML 1.0, and DOM 2 (still a work in progress), no longer based on SGML, but “backward compatible” with parsing of older versions of HTML. HTML 5 is referred to as a "living language".
  • 4. Web Development Tools • many high-level tools exist for creating Web pages e.g., Microsoft FrontPage, Netscape Composer, Adobe PageMill, Macromedia DreamWeaver, HotDog, … also, many applications have "save to HTML" options (e.g., Word) Don’t use these tools!! for most users who want to develop basic, static Web pages, these are fine (but many of these programs produce very poorly structured HTML code)  may want low-level control  may care about size/readability of pages  may want to “borrow" components from other pages and integrate into existing pages  may want dynamic features such as scripts or applets  remote editing of web pages may only be possible using a basic text editor  sticking to (internationally and industrially) agreed upon standards will help ensure your web documents are rendered as you intend them to look and operate as you desire • why are we learning low-level HTML using a basic text editor?
  • 5. Tags and Elements • HTML specifies a set of tags that identify structure of the document and the content type  tags are enclosed in < > <img src="image.gif" /> specifies an image  most tags come in pairs, marking a beginning and ending <title> and </title> enclose the title of a page • an HTML element is an object enclosed by a pair (in most cases) of tags <title>My Home Page</title> is a TITLE element <b>This text appears bold.</b> is a BOLD element <p>Part of this text is <b>bold</b>. </p> is a PARAGRAPH element that contains a BOLD element An HTML document is a collection of elements (text/media with context).
  • 6. Structural Elements • a standard HTML document has two main structural elements  head contains setup information for the browser & the Web page e.g., the title for the browser window, style definitions, JavaScript code, …  body contains the actual content to be displayed in the Web page <html> <!–- Version information -- -- File: page01.html -- -- Author: UTA005 -- -- Creation: 13.01.15 -- -- Description: introductory page -- -- Copyright: Thapar University -- --> <head> <title>My first HTML document</title> </head> <body> <p> Hello world! </p> </body> </html> HTML documents begin and end with <html> and </html> tags Comments appear between <!-- and --> head section enclosed between <head> and </head> tags body section enclosed between <body> and </body> * Find more info on HTML docs! view page
  • 7.  The <head> element is where you include a <title> element (that appears in the title bar of the browser). You can also include lots of other type of information in the <head> element. o Cascading Style sheet information, or a link to an external style sheet (or several) o “Meta” data, such as who authored the page, the type of content, and clues that search engines may (or may not) use to help categorize your page o JavaScript code The <body> element contains the main bulk of the material to be displayed on the webpage. o Paragraphs o Tables and lists o Images o JavaScript code o PHP code can be included here too (if passed through a PHP parser before being served to the client’s browser) o Other embedded objects (videos, etc) <head> and <body> elements
  • 8. Text Layout for the most part, layout of the text is left to the browser  (almost) every sequence of whitespace is interpreted as a single space  browser automatically wraps the text to fit the window size can override some text layout  can specify a new paragraph (starts on a new line, preceded by a blank line) using <p>…</p>  can cause a line break using the <br/> tag (“self-closing” tag)  can force a space character using the symbol for a “non-breaking space”: &nbsp; <html> <!–- UTA005 page2.html 13.01.15 --> <head> <title>Text Layout</title> </head> <body> <p> This is a paragraph of text<br/> made up of two lines. </p> <p> This is another paragraph with a &nbsp; GAP &nbsp; between some of the words. </p> <p> &nbsp;&nbsp; This paragraph is<br/> indented on the first line<br/> but not on subsequent lines. </p> </body> </html> view page
  • 9. Separating Blocks of Text can specify headings for paragraphs or blocks of text  <h1>…</h1> tags produce a large, bold heading  <h2>…</h2> tags produce a slightly smaller heading . . .  <h6>…</h6> tags produce a tiny heading can insert a horizontal rule to divide sections  <hr/> (or use <hr>) draws line across window <html> <!–- UTA005 page3.html 13/01/15 --> <head> <title>Blocks of Text</title> </head> <body> <h1>Major heading 1</h1> <p> Here is some text. </p> <h2>Subheading</h2> <p> Here is some subtext. </p> <hr/> <h1>Major heading 2</h1> <p> Here is some more text. </p> </body> </html> view page
  • 10. The Basic Web page – A Worked Example <html> <!–- UTA005 page22.html 13.01.15 --> <head> <title> Computer Science & Engineering Department </title> </head> <body> <h1>Computer Science & Engineering Department</h1> <h2>Mission</h2> <p> To provide the state of art infrastructure and professional environment that enables students and staff to make significant contribution in Computer Science and Engineering. </p> <hr/> <h2> Vision </h2> <p> To be recognized as a leader committed to excellence in Computer Science and Engineering education, research and innovation.</p> <hr/> </body> </html> view page
  • 11. Text Appearance can specify styles for fonts  <b>… </b> specify bold  <i>… </i> specify italics  <tt>… </tt> specify typewriter- like (fixed-width) font  <small>… </small> decreases the size of the font  <em>…</em> puts emphasis  <strong>…</strong> puts even more emphasis  <sub>… </sub> specify a subscript  <sup>… </sup> a superscript  <pre>…</pre> include ready- formatted text  &amp; &al; &gt; &quot; &copy; escape characters used in HTML control • Find more info on text tags! <html> <!–- UTA005 page25.html 13.01.15 --> <head> <title>Text Variations and Escape Sequences</title> </head> <body> <h1>Text Variations</h1> <p>We can use <b>simple</b> tags to <i>change</i> the appearance of <strong>text</strong> within <tt>Web pages</tt>. Even super<sup>script</sup> and sub<sub>scripts</sub> are <em>supported</em>.</p> <h1>Text Escape Sequences</h1> <p> &amp; &lt; &gt; &quot; &copy; </p> <h1>Preformatted text</h1> <pre> Thapar University Department of Computer Science Patiala,Punjab,India </pre> </body> </html> view page
  • 12. Lists there are 3 different types of list elements  <ol>…</ol> specifies an ordered list (using numbers or letters to label each list item) <li> identifies each list item can set type of ordering, start index  <ul>…</ul> specifies unordered list (using a bullet for each) <li> identifies each list item  <dl>…</dl> specifies a definition list <dt> identifies each term <dd> identifies its definition * We will learn more about the “style” attributes soon enough. <html> <!–- UTA005 page7.html 13.01.15 --> <head> <title>(Sort of) Simple Lists</title> <style type="text/css"> .my_li:before { content: counter(list) ": "; counter-increment: list; } </style> </head> <body> <ul style="list-style-type: square;"> <li> ... first list item... </li> <li> ... second list item... ... </li> </ul> <dl> <dt> Dweeb </dt> <dd> young excitable person who may mature into a <em>Nerd</em> </dd> <dt> Hacker </dt> <dd> a clever programmer </dd> <dt> Nerd </dt> <dd> technically bright but socially inept person </dd> </dl> <ol style="list-style-type: none; counter-reset: list 29;" > <li class="my_li">Makes first item number 30.</li> <li class="my_li">Next item continues to number 31.</li> </ol> </body> </html> view page
  • 13. Hyperlinks perhaps the most important HTML element is the hyperlink, or ANCHOR  <a href="URL">…</a> where URL is the Web address of the page to be displayed when the user clicks on the link if the page is accessed over the Web, must start with http:// if not there, the browser will assume it is the name of a local file  <a href="URL" target="_blank">…</a> causes the page to be loaded in a new Window * Find more info on attribute TARGET <html> <!–- UTA005 page8.html 13.01.15 --> <head> <title>Hyperlinks</title> </head> <body> <p> <a href="http://www.thapar.edu"> Thapar University</a> <br/> <a href="page7.html" target="_blank"> Open page07 in a new window</a> </p> </body> </html> view page
  • 14. Hyperlinks (cont.) for long documents, you can even have links to other locations in that same document  <xxxx id="ident">…</xxxx> where ident is a variable for identifying this location, where "xxxx" can, in principle, be any HTML element (this is actually an HTML5 language specification, but seems to work in most browsers)  <a href="#ident">…</a> will then jump to that location within the file  <a href="URL#ident">…</a> can jump into the middle of another file just as easily <html> <!–- UTA005 page9.html 14.01.15 --> <head> <title>Internal Links in a Page</title> </head> <body> <p> [ <a href="#HTML">HTML</a> | <a href="#HTTP">HTTP</a> | <a href="#IP">IP</a> | <a href="#TCP">TCP</a> ] </p> <p> Computer acronyms: <dl> <dt id="HTML">HTML</dt> <dd>HyperText Markup Language <dt id="HTTP">HTTP</dt> <dd>HyperText Transfer Protocol…</dd> <dt id="IP">IP</dt> <dd>Internet Protocol…</dd> <dt id="TCP">TCP</dt> <dd>Transfer Control Protocol…</dd> </dl> </p> </body> </html> view page
  • 15. Images can include images using img  by default, browsers can display GIF and JPEG files, more modern browsers can also typically support PNG files and SVG graphics (of course, use at your own risk)  other image formats may require plug-in applications for display <img src="URL (or filename)" height="n" width="n" alt="text" title= "text" /> again, if file is to be accessed over the Web, must start with http:// (if not, will assume local file) * Find more info on <img /> <html> <!–- UTA005 page10.html 14.01.15 --> <head> <title>Image example</title> </head> <body> <img src="C:UserskDesktoputa005htmlcomputer.gif" title=“Computer Science Department" alt="image of Computer Science Department " width="400" /> <p>The Computer Science Department </p> </body> </html> view page
  • 16.  src - specifies the file name (and can include a URL)  width and/or height - dimensions in pixels (often only need to specify one of them and the other is automatically scaled to match, where possible pictures should be resized using other programs to save on bandwidth and problems that some (older) browsers might have with resizing images)  title - displayed when the mouse is “hovered” over the picture  alt - text that is displayed when the image is missing, can’t be loaded (e.g. if file permissions aren’t set correctly), or if the client has disabled loading images in his/her browser Images (cont.)
  • 17. Tables • tables are a common method for displaying data and other information  a table divides contents into rows and columns  by default, column entries are left-justified, so you must provide for your own alignment when needed (using Cascading Style Sheets, for example) <html> <!–- UTA005 page11.html 14.01.15 --> <head> <title>Tables</title> </head> <body> <h2>A Simple Table</h2> <table> <tr> <td> Left Column </td> <td> Right Column </td> </tr> <tr> <td> Some data </td> <td> Some other data </td> </tr> </table> </body> </html> <table>…</table> specify a table element <tr>…</tr> specify a row in the table <td>…</td> specify table data (i.e., each column entry in the table) view page
  • 18. Layout in a Table can have a border on tables using the “style” attribute <table style= "border: 1px solid;"> increasing the number makes the border thicker can control the horizontal & vertical layout within cells <td style= "text-align:center"> <td style= "vertical-align: bottom"> can apply layout to an entire row <tr style="text-align: center"> <tr style="vertical-align: top"> We will explore this more with Cascading Style Sheets (CSS). <html> <!– UTA005 page12.html 14.01.15 --> <head> <title>Table Layout</title> </head> <body> <table style="border: 1px solid;"> <tr style="text-align: center;"> <td style="border: 1px solid;"> Left<br/>Column</td> <td style="border: 1px solid; vertical-align: top;"> Right Column</td> </tr> <tr> <td style="border: 1px solid;"> Some data</td> <td style="border: 1px solid;"> Some data</td> </tr> </table> </body> </html> view page
  • 19. Table Width by default, the table is sized to fit the data can override & specify the width of a table relative to the page For example <table style="width: 60%"> <html> <!– UTA005 page13.html 14.01.15 --> <head> <title>Table Width</title> </head> <body> <table style="width: 100%;"> <tr> <td>left-most </td> <td style="text-align: right;"> right-most</td> </tr> </table> </body> </html> view page
  • 20. Other Table Attributes can control the space between cells & margins within cells This is the “padding” attribute in the table and th,td style sheet declarations (more on this with Cascading Style Sheets). can add headings <th> is similar to <td> but displays heading centered in bold can have data that spans more than one column <td colspan="2"> similarly, can span more than one row <td rowspan="2"> (This example uses CSS style sheet commands in the page <header>.) <html> <!– UTA005 page14.html 14.01.15 --> <head> <title>Table Formatting</title> <style type="text/css" media="screen"> table { border: 1px solid; padding: 1px;} th, td { border: 1px solid; padding: 10px; text-align: center; } </style> </head> <body> <table> <tr> <th>HEAD1</th> <th>HEAD2</th> <th>HEAD3</th> </tr> <tr> <td>one</td> <td>two</td> <td>three</td> </tr> <tr> <td rowspan="2"> four </td> <td colspan="2"> five </td> </tr> <tr> <td> six </td> <td> seven </td> </tr> </table> </body> </html> view page