Unit 1 - HTML-st
Unit 1 - HTML-st
us
INTRODUCTION TO WEB TECHNOLOGIES
• HTML elements: Headings, paragraphs, colors and fonts, links, frames, lists, tables, images and
forms, block and inline elements, HTML Semantic elements, Difference between HTML and
HTML5. Understanding HTML5 Media.
• Case Study: Create a Webpage and Survey form using suitable HTML Tags and style-sheet.
Introduction to Web Technology
•Web
• The web is collection of documents that are
interconnected by hyper links.
• These documents are accessed by web browsers
and provided by web servers.
• WWW (World Wide Web)
•The WWW sometimes only pronounced simply as
Web, is a way of retrieving information over the
internet.
•HTTP protocol is used by the web to
transmit data over the internet.
•Website
Cont
.. as web
•A website is made up of web pages. These web pages also known
documents are interconnected with each other with the help of hyperlinks.
•Such webpages can be accessed by using various web browsers like IE,
Chrome, Firefox etc.. The web document can contain tables, simple
text, graphics etc..
•Web sites are usually created for commercial purpose. There are various
extensions of web sites depending upon their prime purpose.
• .com – Commercial
• .org – Organization
• .net – Network
• .biz – Business
• .edu – Education
Cont..
•Website :
• Also there are some extensions depending upon the countries
• .in - India
• .uk – United Kingdom
• .us – America
• .nz – New Zealand
Cont..
•For any Website there are basically 2 important aspect
•Web Designing
•Web Development (Scripting)
• Web Designing
•As the basic intention of web site is always commercial, it s necessary
that the website should be user friendly and attractive.
•For designing purpose various scripting languages like HTML, CSS and
software tools like Photoshop, CorelDraw, flash are used.
HTM
L
HTML
•Getting started with HTML
•Why HTML
•HTML Form
•Media (Audio, Video)
</html>
<!DOCTYPE html>
Browser
Support
• HTML 4.01:
• <!DOCTYPEHTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE> declaration is NOT case
sensitive.
Examples
<!DOCTYPE 8
html>
<!DocType
html>
<!Doctype
html>
<!doctype
HTML <a> Tag
html>
• Example
• Live Demo
HTML Heading-Paragraph-Line Breaks
• HTML tags are standard keywords in the web page which define how the web
browser should format and display the content.
• Headings
• <h1> </h1>
• <h2> </h2>
• Upto <h6>
• Attributes of <frameset>
• border : width of the border. For eg : border=“3”.
• Frameborder : this attributes mentions whether to display a three dimensional border
between frames or not. It takes value 1 (true) or 0 (false). For eg: frameborder = “1” specifies
frame with three dimensional border.
HTML Lists
• Lists:
• Type of HTML list
• Ordered
• Type : 1. Number I: Upper roman i: Lower roman A: upper Alpha a: lower alpha
• Unordered
• Attribute : type : circle, square, disc
• Definition
• <dl> : Defining beginning of list
• <dt> : Specify the term
• <dd> : Specify term definition
• </dl> : End of list
HTML
T ables
• HTML tables allow web developers to arrange data into rows and
columns.
Each table cell is defined by a <td> and a </td> tag.
<table>
<tr>
<td>Emil</td>
<td>Tobias</td>
<td>Linus</td>
</tr>
</table>
Note: table data elements are the data containers of the table.
They can contain all sorts of HTML elements; text, images, lists, other tables,
etc.
Table
Rows
Each table row starts with a <tr> and end with a </tr>
tag.
Table Headers
use the <th> tag instead of the <td> tag
TAG Description
• Rowspan:
• Used to define the number of rows a cell should span (or merge) vertically. rowspan
merge the cells vwrtically, default value for rowspan is 1.
• <td rowspan= 2> merged </td>
HTML Image
• Images :
• 2 option to insert image in webpage
• Using <body> tag : body tag has a background attribute to set image as a
background of the page.
<body background = “Desert.jpg”>
Live Demo
Attribute Value Description
Attributes of
align Top bottom left Specifies the
Image Tag middle right alignment of an
image
alt Text Defines an alternate
text for the image
border Pixels Defines the width
of the border
around an image
height Pixels Defines the height
of the image
hspac Pixels Defines the
e whitesapce on both
of the left and right
side of an image
vspac Pixels Defines the
e whitesapce on top and
bottom of an image
src URL Defines the URL
of an image
HTML form
• The HTML form is a part of a document which may have general content,
special elements known as controls like textfields, checkboxex , submit
button, radio buttons etc. users usually complete the form by modifying it’s
elements.
• HTML forms are generally necessary when we want to accept some data from
the website visitors. For example email account form, credit card form where we
may like to accept information like name, email address, phone number, gender etc.
HTML HTML5
<audio> and <video> <audio> and <video>
tags are not supported tags are supported
•Types of CSS
•Properties
CS38 5
0 7
Basic CSS rule syntax
selector
{ property:
value; property:
value;
...
property: value; CS
} S
p {
font-family: sans-serif;
color: red;
} CS
• S
A CSS file consists of one or more rules
• Each rule starts with a selector
• A selector specifies an HTML element(s) and then
applies style
properties to them
• a selector of * selects all elements 7
2
Attaching a CSS file <link>
<head>
...
<link href="filename" type="text/css" rel="stylesheet" />
...
</head> HTML
This is a paragraph
output
propert description
y color color of the element's text
color that will appear
background-
behind the element
color
CS38 75
0
Specifying colors
p { color: red; }
h2 { color: rgb(128, 0, 196); }
h4 { color: #FF8800; }
CSS
CS38 78
0
CSS properties for fonts
property description
font- which font will be used
family how large the letters will be
font-size drawn used to enable/disable
font-style italic style used to
font- enable/disable bold style
weight
Complete list of font properties
(http://www.w3schools.com/css/css_reference.asp#font)
CS38 79
0
font-family
p {
font-family: Georgia;
}
h2 {
font-family: "Courier New";
} CS
S
This paragraph uses the first style above.
CS38 80
0
More about font-family
p {
font-family: Garamond, "Times New Roman", serif;
} CSS
• If the first font is not found on the user's computer, the next is tried
• Placing a generic font name at the end of your font-family value, ensures that every
computer will use a valid font
CS38 81
0
font-size
p {
font-size: 24pt;
}
ThisCSS
paragraph uses the style above.
output
• units: pixels (px) vs. point (pt) vs. m-size (em)
16px, 16pt, 1.16em
• vague font sizes: xx-small , x-small , small , medium, large, x-large, xx-large, smaller,
larger
• percentage font sizes, e.g.: 90%, 120%
CS38 82
0
font-size
p {
font-size: 24pt;
}
ThisCSS
paragraph uses the style above.
output
• pt specifies number of point, where a point is 1/72 of an inch onscreen
• px specifies a number of pixels on the screen
• em specifies number of m-widths, where 1 em is equal to the font's
current size
CS38 83
0
font-weight, font-style
p {
font-weight: bold;
font-style: italic;
} CS
S
This paragraph uses the style above.
output
CS38 84
0
CSS properties for text
property description
text-align alignment of text within its
text- element decorations such as
decoration underlining
gaps between the various
line-height,
portions of the text
word-
spacing, indents the first letter of
text-
letter- each paragraph
indent
spacing
Complete list of text properties
(http://www.w3schools.com/css/css_reference.asp#text)
CS38 85
0
text-align
blockquote { text-align: justify; }
h2 { text-align: center; }
CSS
We wants it, we needs it. Must have the precious. They stole it from us.
Sneaky little hobbitses. Wicked, tricksy, false!
output
• text-align can be left, right, center,
or justify
CS38 86
0
text-decoration
p {
text-decoration: underline;
} CS
S
This paragraph uses the style above.
output
CS38 87
0
The list-style-type property
ol { list-style-type: lower-roman; }
CSS
• Possible values:
i.none : No marker
iii.Decimal: 1, 2, 3, etc.
vii.lower-alpha: a, b, c, d, e, etc.
viii.upper-alpha: A, B, C, D, E, etc.
CS38 88
0
Body styles
body {
font-size: 16px;
}
CSS
CS38 89
0
Cascading Style Sheets
• Properties of an element cascade together in
this order:
• browser's default styles
• external style sheet files (in a <link> tag)
• internal style sheets (inside a <style> tag in the
page's header)
• inline style (the style attribute of the HTML
element)
CS38 90
0
Inheriting styles
body { font-family: sans-serif; background-color: yellow;
}
p { color: red; background-color: aqua; }
a { text-decoration: underline; }
h2 { font-weight: bold; text-align:
center; }
CSS
This is a heading
A styled paragraph. Previous slides are available on the website.
CS38 92
0
W3C CSS Validator
<p>
<a
href="http://jigsaw.w3.org/css-validator/check/referer">
<img src="http://jigsaw.w3.org/css-validator/images/vcss"
alt="Valid CSS!" /></a>
</p>
CSS
output
• jigsaw.w3.org/css-validator/
• checks your CSS to make sure it meets the
official CSS specifications
CS38 93
0
CSS properties for backgrounds
property description
background- color to fill background
color image to place in
background- background
image placement of bg image
within element
background- whether/how bg image
position should be repeated
whether bg image scrolls
background-repeat with page
shorthand to set all
background- background properties
attachment CS38
0
94
background-image
body {
background-image: url("images/draft.jpg");
}
CSS
CS38 95
0
background-repeat
body {
background-image: url("images/draft.jpg");
background-repeat: repeat-x;
}
CSS
CS38 96
0
background-position
body {
background-image: url("images/draft.jpg");
background-repeat: no-repeat;
background-position: 370px 20px;
} CS
S
•CSS Id Selector
• The Id selector is similar to the class selector.
• Bootstrap Responsive
• Bootstrap Classes