Professional Documents
Culture Documents
Introduction to HTML
What is HTML?
Example of HTML
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
Output:
HTML ELEMENTS
An HTML element is defined by a start tag, some content, and an end tag:
It is used to display Web Page.
DOCTYPE HTML
HTML TAG
HEAD TAG
BODY TAG
element defines the document's body, and is a container for all the visible contents,
such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
Output:
2. HEADINGS TAG- <H1></H1> TO <H6> </H6>
Element defines a large heading.
EX.
Output:
3. PARAGRAPH TAG - <P> </P>
Element defines a paragraph.
EX.
Output:
4. IMAGE TAG - <img scr = “ “ > </img>
Used to embed an image in an HTML page.
Creates a holding space for the referenced image.
EX.
Output:
5. LIST TAG - <LI> </LI>
HTML lists allow web developers to group a set of related items in lists.
Ex.
Output:
HOW TO SAVE HTML FILE
1.
-Insert your HTML to NOTEPAD
2.
-Click SAVE AS or use Keyboard shortcut: (CTRL + SHIFT + S)
3.
5.
-Double Click your html file to Open it on your Default Browser.
NOTE: Right click it and click Open As. Then Click Notepad, if you want to
Revise something on your previous work.
output:
6.
Introduction to CSS
What is CSS?
CSS stands for Cascading Style Sheets
CSS describes how HTML elements are to be displayed on screen, paper, or in other
media
CSS saves a lot of work. It can control the layout of multiple web pages all at once
External stylesheets are stored in CSS files
CSS Selectors
CSS selectors are used to "find" (or select) the HTML elements you want to style.
1. . (Period) Selector
It is used to define a class.
Example:
Output:
2. Class Selector
It is used to assign a class or class to a specific HTML tag, such as <P> and <H1>
Example:
Output:
Basic CSS Properties
1. Background Color
Property sets the background color of an element.
Example:
Output:
2. Margin
Property sets the margin area on all four sides of an element. It is a shorthand for
margin-top , margin-right , margin-bottom , and margin-left .
Ex.
3. Float
Property places an element on the left or right side of its container, allowing text and
inline elements to wrap around it.
Ex.
Output:
4. Height
Property sets the height of an element.
Ex.
Output:
5. Width
Property sets the width of an element.
Ex.
Output:
6. Selector
CSS selectors are used to "find" (or select) the HTML elements you want to style.
Ex.
Output:
7. Color
property specifies the color of text.
Ex.
Output:
8. Padding
Property in CSS defines the innermost portion of the box model, creating space around
an element's content, inside of any defined margins and/or borders.
Ex.
Output: