Professional Documents
Culture Documents
of HTML
and CSS and Web
Consultancy
Programming Part 2
HTML
HTML is amarkuplanguage fordescribingweb documents (web pages).
HTML stands forHyperTextMarkupLanguage
A markup language is a set ofmarkup tags
HTML documents are described byHTML tags
Each HTML tagdescribesdifferent document content
Hypertext markup language is processed by the browser (or some html
Year
HTML
1991
HTML+
1993
HTML 2.0
1995
HTML 3.2
1997
HTML 4.01
1999
XHTML
2000
HTML5
2012
HTML5
<!DOCTYPE html>
HTML 4.01
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"http://www.w3.org/TR/html4/lo
ose.dtd">
XHTML 1.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN""http://www.w3.org/TR/xhtml1/D
TD/xhtml1-transitional.dtd">
http://www.ifour-consul
HTML Attributes
Attribute Description
alt
disabled
href
id
src
style
title
value
http://www.ifour-consul
Are used to control how elements are presented in the Web page
Use a different syntax that HTML/XHTML
Work with the common visual browsers (Internet Explorer, FireFox, Opera)
Used properly, can great simplify visual design, site management and
content maintenance
http://www.ifour-consul
CSS Type
CSS styling can be added to HTML elements the following 3 ways:
Inline - using the styleattributein HTML elements
Internal - using the <style>elementin the <head> section
External - using external CSSfiles
Inline Styles
Inline stylingis useful for applying a unique style to a single HTML element:
Inline styling uses thestyle attribute.
This line styling changes the text color and the left margin of single
paragraph:
Example
<pstyle="color:green;margin-left:20px;">This is a paragraph.</p>
http://www.ifour-consul
http://www.ifour-consul
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color:lightgrey}
h1 {color:blue}
p {color:green}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
http://www.ifour-consul
CSS Selector
CSS selectors allow you to select and manipulate HTML element(s).
CSS selectors are used to "find" (or select) HTML elements based on
their id, classes, types, attributes, values of attributes and much more.
The element Selector
The element selector selects elements based on the element name.
You can select all <p> elements on a page like this: (all <p> elements
will be center-aligned, with a red text color)
p{
text-align:center;
color:red;
}
http://www.ifour-consul
The id Selector
The id selector uses the id attribute of an HTML tag to find the specific element.
An id should be unique within a page, so you should use the id selector when
#para1{
text-align:center;
color:red;
}
http://www.ifour-consul
http://www.ifour-consul
.center{
text-align:center;
color:red;
}
http://www.ifour-consul
Summery
HTML is a language to create Web documents. It is superceded by XHTML, but will
continue to work in browsers for a few years. HTML tags provide structure for text or
other information in a document.
There are 216 Web-safe colours. While you can use 16million colours, if a users
monitor cannot display that colour, their computer will dither to the nearest colour. To
anticipate this, use the Web-safe palette or adaptive dither.
There are four ways to encode style information in HTML documents:
The HTML Styles method if you dont use CSS.
Top-of-the-page styles
The linked CSS document
Inline styles
http://www.ifour-consul
References
W3schools.com
Google.co.in
W3.org
http://www.ifour-consul