Web School Resources (Autosaved)
Web School Resources (Autosaved)
Week one
INTRODUCTION TO HTML
WHAT IS HTML
HTML TAGS
INTRODUCTION TO HTML
HTML Tutorial
HTML tutorial or HTML 5 tutorial provides basic and advanced concepts of HTML. Our
HTML tutorial is developed for beginners
HTML stands for HyperText Markup Language.
HTML is used to create web pages and web applications.
HTML is widely used language on the web.
We can create a static website by HTML only.
Technically, HTML is a Markup language rather than a programming language.
HTML Example with HTML Editor
<!DOCTYPE>
<html>
<head>
<title>Web page title</title>
</head>
<body>
<h1>Write Your First Heading</h1>
<p>Write Your First Paragraph.</p>
</body>
</html>
Write Your First Heading
Write Your First Paragraph.
HTML is an acronym which stands for Hyper Text Markup Language which is used for creating web
pages and web applications. Let's see what is meant by Hypertext Markup Language, and Web page.
Hyper Text: HyperText simply means "Text within Text." A text has a link within it, is a hypertext.
Whenever you click on a link which brings you to a new webpage, you have clicked on a hypertext.
HyperText is a way to link two or more web pages (HTML documents) with each other.
Markup language: A markup language is a computer language that is used to apply layout and
formatting conventions to a text document. Markup language makes text more interactive and dynamic.
It can turn text into images, tables, links, etc.
Web Page: A web page is a document which is commonly written in HTML and translated by a web
browser. A web page can be identified by entering an URL. A Web page can be of the static or dynamic
type. With the help of HTML only, we can create static web pagE
Description of HTML Example
<!DOCTYPE>: It defines the document type or it instruct the browser
about the version of HTML.
<html > :This tag informs the browser that it is an HTML document. Text
between html tag describes the web document. It is a container for all
other elements of HTML except <!DOCTYPE>
<head>: It should be the first element inside the <html> element, which
contains the metadata(information about the document). It must be closed
before the body tag opens.
<title>: As its name suggested, it is used to add title of that HTML page
which appears at the top of the browser window. It must be placed inside
the head tag and should close immediately. (Optional)
<body> : Text between body tag describes the body content of the page
that is visible to the end user. This tag contains the main content of the
HTML document.
<h1> : Text between <h1> tag describes the first level heading of the
webpage.
<p> : Text between <p> tag describes the paragraph of the webpage.
Building blocks of HTML
An HTML document consist of its basic building blocks
which are:
o Tags: An HTML tag surrounds the content and apply meaning
to it. It is written between < and > brackets.
o Attribute: An attribute in HTML provides extra information
about the element, and it is applied within the start tag. An
HTML attribute contains two fields: name & value.
Syntax
<tag name attribute_name= " attr_value"> content </ tag nam
e>
o Elements: An HTML element is an individual component of an
HTML file. In an HTML file, everything written within tags are
termed as HTML elements.
<!DOCTYPE html>
<html>
<head>
<title>The basic building blocks of HTML</title>
</head>
<body>
<h2>The building blocks</h2>
<p>This is a paragraph tag</p>
<p style="color: red">The style is attribute of paragraph tag</
p>
<span>The element contains tag, attribute and content</
span>
</body>
</html>
HTML Tags
HTML tags are like keywords which defines that how web browser will
format and display the content. With the help of tags, a web browser
can distinguish between an HTML content and a simple content. HTML
tags contain three main parts: opening tag, content and closing tag.
But some HTML tags are unclosed tags.
HTML Text Tags
<p>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <strong>, <em>, <abbr>, <acronym>,
<address>, <bdo>, <blockquote>, <cite>, <q>, <code>, <ins>, <del>, <dfn>, <kbd>, <pre>,
<samp>, <var> and <br>
________________________________________
HTML Attribute
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1> This is Style attribute</h1>
<p style="height: 50px; color: blue">It will add style property in element</p>
<p style="color: red">It will change the color of content</p>
</body>
</html>
HTML Elements
HTML FORMATTING
HTML PARAGRAPH
HTML ANCHOR
HTML Formatting
HTML Formatting
HTML Formatting is a process of formatting text for
better look and feel. HTML provides us ability to
format text without using CSS. There are many
formatting tags in HTML. These tags are used to
make text bold, italicized, or underlined. There are
almost 14 options available that how text appears in
HTML and XHTML.
In HTML the formatting tags are divided into two
categories:
o Physical tag: These tags are used to provide the visual
appearance to the text.
o Logical tag: These tags are used to add some logical or semantic
value to the text.
Element name Description
<b>
HTML IMAGES
HTML TABLES
HTML Image
HTML img tag is used to display image on the web page. HTML img
tag is an empty tag that contains attributes only, closing tags are not
used in HTML image element.
Let's see an example of HTML image.
image
<img src="animal.jpg"
height="180" width="30
0" alt="animal image">
HTML Table
Tag Description
<table>
<tr><th>First_Name</th><th>Last_Name</th><th>Marks</
th></tr>
<tr><td>Sonoo</td><td>Jaiswal</td><td>60</td></tr>
<tr><td>James</td><td>William</td><td>80</td></tr>
<tr><td>Swati</td><td>Sironi</td><td>82</td></tr>
<tr><td>Chetna</td><td>Singh</td><td>72</td></tr>
</table>
First_Name Last_Name Marks
onoo Jaiswal 60
mes William 80
wati Sironi 82
hetna Singh 72
<table border="1">
<tr><th>First_Name</th><th>Last_Name</th><th>Marks</th></
tr>
<tr><td>Sonoo</td><td>Jaiswal</td><td>60</td></tr>
<tr><td>James</td><td>William</td><td>80</td></tr>
<tr><td>Swati</td><td>Sironi</td><td>82</td></tr>
<tr><td>Chetna</td><td>Singh</td><td>72</td></tr>
</table>
Output:
Sonoo Jaiswal 60
Output:
James William 80
Swati Sironi 82
Chetna Singh 72
) CSS Border property
It is now recommended to use border property of CSS to specify border in table.
1. <style>
2. table, th, td {
3. border: 1px solid black;
4. }
5. </style>
Week four
HTML LIST
HTML Lists
HTML Lists are used to specify lists of information. All lists may contain
one or more list elements. There are three different types of HTML lists:
Ordered List or Numbered List (ol)
Unordered List or Bulleted List (ul)
Description List or Definition List (dl)
HTML Ordered List or Numbered List
In the ordered HTML lists, all the
list items are marked with numbers
by default. It is known as numbered
list also. The ordered list starts with
<ol> tag and the list items start
with <li> tag
<ol>
<li>Aries</li>
<li>Bingo</li>
<li>Leo</li>
<li>Oracle</li>
</ol>
Output:
1. Aries
2. Bingo
3. Leo
4. Oracle
HTML Unordered List or Bulleted List
Output:
o Aries
o Bingo
o Leo
o Oracle
Week five
Html form
HTML Form
The HTML <input> element is fundamental form element. It is used to create form
fields, to take input from user. We can apply different input filed to gather different
information form user. Following is the example to show the simple text input.
Example:
1. <body>
2. <form>
3. Enter your name <br>
4. <input type="text" name="username">
5. </form>
6. </body>
Output:
1. <form>
2. <label for="firstname">First Name:
</label> <br/>
3. <input type="text"
id="firstname" name="firstname"/> <br/>
4. <label for="lastname">Last Name:
</label>
5. <input type="text" id="lastname"
name="lastname"/> <br/>
6. </form>
1. <form>
2. <label for="gender">Gender: </label>
3. <input type="radio" id="gender"
name="gender" value="male"/>Male
4. <input type="radio" id="gender"
name="gender" value="female"/>Female <br/>
5. </form>
7. <h2>Registration form</h2>
8. <form>
9. <fieldset>
10. <legend>User personal
information</legend>
11. <label>Enter your full
name</label><br>
12. <input type="text"
name="name"><br>
13. <label>Enter your
email</label><br>
14. <input type="email"
name="email"><br>
15. <label>Enter your
password</label><br>
16. <input type="password"
name="pass"><br>
17. <label>confirm your
password</label><br>
18. <input type="password"
name="pass"><br>
19. <br><label>Enter your
gender</label><br>
20. <input type="radio" id="gender"
name="gender" value="male"/>Male <br>
Html end
CSS CLASS
CSS WEEK ONE
o Introduction to CSS
o What is CSS
o CSS Syntax
o CSS Selector
o How to Add CSS
o CSS stands for Cascading Style Sheet.
o CSS is used to design HTML tags.
o CSS is a widely used language on the web.
o HTML, CSS and JavaScript are used for web
designing. It helps the web designers to apply style
on HTML tags
CSS Example with CSS Editor
1. <!DOCTYPE>
2. <html>
3. <head>
4. <style>
5. h1{
6. color:white;
7. background-color:red;
8. padding:5px;
9. }
10. p{
11. color:blue;
12. }
13. </style>
14. </head>
15. <body>
16. <h1>Write Your First CSS Example</h1>
17. <p>This is Paragraph.</p>
18. </body>
19. </html>
CSS Selector
CSS selectors are used to select the content you want to style.
Selectors are the part of CSS rule set. CSS selectors select HTML
elements according to its id, class, type, attribute etc.
There are several different types of selectors in CSS.
1. CSS Element Selector
2. CSS Id Selector
3. CSS Class Selector
4. CSS Universal Selector
5. CSS Group Selector
CSS Element Selector
1. <!DOCTYPE html>
2. <html>
3. <head>
4. <style>
5. p{
6. text-align: center;
7. color: blue;
8. }
9. </style>
10. </head>
11. <body>
12. <p>This style will be applied on every paragraph.</p>
CSS Id Selector
2. <html>
3. <head>
4. <style>
5. *{
6. color: green;
7. font-size: 20px;
8. }
9. </style>
10. </head>
11. <body>
12. <h2>This is heading</h2>
13. <p>This style will be applied on every paragraph.</p>
14. <p id="para1">Me too!</p>
15. <p>And me!</p>
16. </body>
17. </html>
2. <html>
3. <head>
4. <style>
5. *{
6. color: green;
7. font-size: 20px;
8. }
9. </style>
10. </head>
11. <body>
12. <h2>This is heading</h2>
13. <p>This style will be applied on every paragraph.</p>
14. <p id="para1">Me too!</p>
15. <p>And me!</p>
16. </body>
17. </html>
How to add CSS
External CSS is used to apply CSS on multiple pages or all pages. Here,
we write all the CSS code in a css file. Its extension must be .css for
example style.css.
For example:
1. p{color:blue}
You need to link this style.css file to your html pages like this:
1. <link rel="stylesheet" type="text/css" href="style.css">
The link tag must be used inside head section of html.
WEEK TWO
o CSS Background
o CSS Border
o CSS Display
o CSS Float
o CSS Font
o CSS Line Height
o CSS Margin
CSS Background
This CSS property sets the rounded borders and provides the rounded
corners around an element, tags, or div. It defines the radius of the
corners of an element.
It is shorthand for border top-left-radius, border-top-right-radius,
border-bottom-right-radius and border-bottom-left-radius. It gives the
rounded shape to the corners of the border of an element. We can
specify the border for all four corners of the box in a single declaration
using the border-radius. The values of this property can be defined in
percentage or length units.
CSS property includes the properties that are
tabulated as follows:
Property Description
border-top-left-radius It is used to set the border-
radius for the top-left corner
border-top-right-radius It is used to set the border-
radius for the top-right corner
border-bottom-right-radius It is used to set the
border-radius for the bottom-right corner
border-bottom-left-radius It is used to set the
border-radius for the bottom-left corner
13. height: 150px;
14. }
15. p{
16. font-size: 25px;
17. }
18. #one {
19. border-radius: 90px;
20. background: lightgreen;
21. }
22. #two {
23. border-radius: 25% 10%;
24. background: orange;
25. }
26. #three {
27. border-radius: 35px 10em 10%;
28. background: cyan;
29. }
30. #four {
31. border-radius: 50px 50% 50cm 50em;
32. background: lightblue;
33. }
34.
35. </style>
36. </head>
37.
CSS Display
clear The clear property is used to avoid elements after the floating elements left, rig
which flow around it. inherit
float It specifies whether the box should float or not. left, righ
Value Description
none It specifies that the element is not floated, and will be displayed just where it occurs in
a default value.
CSS Font property is used to control the look of texts. By the use of CSS font property you
can change the text size, color, style and more. You have already studied how to make
text bold or underlined. Here, you will also know how to resize your font using percentage.
These are some important font attributes:
1. CSS Font color: This property is used to change the color of the text. (standalone
attribute)
2. CSS Font family: This property is used to change the face of the font.
3. CSS Font size: This property is used to increase or decrease the size of the font.
4. CSS Font style: This property is used to make the font bold, italic or oblique.
5. CSS Font variant: This property creates a small-caps effect.
6. CSS Font weight: This property is used to increase or decrease the boldness and
lightness of the font.
is used to change the color of the text.
There are three different formats to define a color:
o By a color name
o By hexadecimal value
o By RGB
In the above example, we have defined all these formats.
1. <!DOCTYPE html>
2. <html>
3. <head>
4. <style>
5. body {
6. font-size: 100%;
7. }
8. h1 { color: red; }
9. h2 { color: #9000A1; }
10. p { color:rgb(0, 220, 98); }
11. }
12. </style>
13. </head>
14. <body>
15. <h1>This is heading 1</h1>
16. <h2>This is heading 2</h2>
17. <p>This is a paragraph.</p>
18. </body>
19. </html>
bold, bolder, lighter or number (100, 200..... upto
900).
1. <!DOCTYPE html>
2. <html>
3. <body>
4. <p style="font-weight:bold;">This font is
bold.</p>
5. <p style="font-weight:bolder;">This font is
bolder.</p>
6. <p style="font-weight:lighter;">This font
is lighter.</p>
7. <p style="font-weight:100;">This font is
100 weight.</p>
8. <p style="font-weight:200;">This font is
200 weight.</p>
9. <p style="font-weight:300;">This font is
300 weight.</p>
10. <p style="font-weight:400;">This font is
400 weight.</p>
11. <p style="font-weight:500;">This font is
500 weight.</p>
12. <p style="font-weight:600;">This font is
600 weight.</p>
13. <p style="font-weight:700;">This font is
700 weight.</p>
CSS Font Size
CSS font size property is used to change the size of the font.
These are the possible values that can be used to set the font size:
5. <body>
6. <p style="font-size:xx-small;"> This font
size is extremely small.</p>
7. <p style="font-size:x-small;"> This font
size is extra small</p>
8. <p style="font-size:small;"> This font size
is small</p>
9. <p style="font-size:medium;"> This font
size is medium. </p>
10. <p style="font-size:large;"> This font size
is large. </p>
11. <p style="font-size:x-large;"> This font
size is extra large. </p>
12. <p style="font-size:xx-large;"> This font
size is extremely large. </p>
13. <p style="font-size:smaller;"> This font
size is smaller. </p>
14. <p style="font-size:larger;"> This font
size is larger. </p>
15. <p style="font-size:200%;"> This font
size is set on 200%. </p>
16. <p style="font-size:20px;"> This font size
is 20 pixels. </p>
17. </body>
CSS Colors
The color property in CSS is used to set the color of HTML elements. Typically, this property is used to
set the background color or the font color of an element.
In CSS, we use color values for specifying the color. We can also use this property for the border-color
and other decorative effects.
We can define the color of an element by using the following ways:
o RGB format.
o RGBA format.
o Hexadecimal notation.
o HSL.
o HSLA.
o Built-in color.
S.no. Color name Hexadecimal Value Decimal Value or rgb() va
The CSS line height property is used to define the minimal height of
line boxes within the element. It sets the differences between two lines
of your content.
It defines the amount of space above and below inline elements. It
allows you to set the height of a line of independently from the font
size.
value description
number It specifies a number that is multiplied with the current font size to set the line heigh
Property Description
margin This property is used to set all the properties in one declaration.
Value Description
length It is used to specify a margin pt, px, cm, etc. its default value is 0px.
o CSS Opacity
o CSS Overflow
o CSS Padding
o CSS Position
CSS Opacity
CSS Padding property is used to define the space between the element
content and the element border.
It is different from CSS margin in the way that CSS margin defines the
space around elements. CSS padding is affected by the background
colors. It clears an area around the content.
Top, bottom, left and right padding can be changed independently
using separate properties. You can also change all properties at once
by using shorthand padding property.
CSS Padding Properties
Property Description
The CSS position property is used to set position for an element. it is also used
to place an element behind another and also useful for scripted animation
effect.
You can position an element using the top, bottom, left and right properties.
These properties can be used only after position property is set first. A position
element's computed position property is relative, absolute, fixed or sticky.
Let's have a look at following CSS positioning:
1. CSS Static Positioning
2. CSS Fixed Positioning
3. CSS Relative Positioning
4. CSS Absolute Positioning
) CSS Static Positioning
This is a by default position for HTML elements. It always positions an element according
to the normal flow of the page. It is not affected by the top, bottom, left and right
properties.
<!DOCTYPE html>
<html>
<head>
<style>
h2.pos_left {
position: relative;
left: -30px;
}
h2.pos_right {
position: relative;
left: 30px;
}
</ style>
</ head>
<body>
<h2>This is a heading with no position</h2>
<h2 class="pos_left">This heading is positioned left according to its normal position</h2>
<h2 class="pos_right">This heading is positioned right according to its normal position</h2>
<p>The style "left:-30px" subtracts 30 pixels from the element's original left position.</p>
<p>The style "left:30px" adds 30 pixels to the element's original left position.</p>
</body>
</html>
4) CSS Absolute Positioning
The absolute positioning is used to position an element relative to the first parent element
that has a position other than static. If no such element is found, the containing block is
HTML.
With the absolute positioning, you can place an element anywhere on a page.
<!DOCTYPE html>
<html>
<head>
<style>
h2 {
position: absolute;
left: 150px;
top: 250px;
}
</ style>
</ head>
<body>
<h2>This heading has an absolute position</ h2>
<p> The heading below is placed 150px from the left and 250px from the top of the page.</ p>
</ body>
</ html>
WEEK 9
CSS Flexbox
CSS3 Flexible boxes also known as CSS Flexbox, is a new layout mode in CSS3.
The CSS3 flexbox is used to make the elements behave predictably when they are used
with different screen sizes and different display devices. It provides a more efficient way
to layout, align and distribute space among items in the container.
It is mainly used to make CSS3 capable to change its item?s width and height to best fit
for all available spaces. It is preferred over block model.
Flex container:The flex container specifies the properties of the parent. It is declared by
setting the display property of an element to either flex or inline-flex.
Flex items:The flex items specify properties of the children. There may be one or more
flex items inside a flex container.
<!DOCTYPE html>
<html>
<head><meta http-equiv="Content-Type" content="text/ html; charset=windows-1252">
<style>
.flex-container {
display: -webkit-flex;
display: flex;
width: 400px;
height: 200px;
. background-color: lightpink;
. }
. .flex-item {
. background-color: brown;
. width: 100px;
. height: 100px;
. margin: 10px;
. }
. </ style>
. </ head>
. <body>
. <div class="flex-container">
. <div class="flex-item">flex item 1</ div>
. <div class="flex-item">flex item 2</ div>
. <div class="flex-item">flex item 3</ div>
. </ div>
. </ body>
. </ html>
Following is a list of CSS3 Flexbox properties:
property description
display it is used to specify the type of box used for an html element.
flex-direction it is used to specify the direction of the flexible items inside a flex container.
justify- it is used to align the flex items horizontally when the items do not use all availa
content main-axis.
align-items it is used to align the flex items vertically when the items do not use all availab
cross-axis.
flex-wrap it specifies whether the flex items should wrap or not, if there is not enough ro
one flex line.
align- it is used to modify the behavior of the flex-wrap property. it is similar to align-it
content of aligning flex items, it aligns flex lines.
flex-flow it specifies a shorthand property for flex-direction and flex-wrap.
order it specifies the order of a flexible item relative to the rest of the flex items inside the
flex it specifies the length of a flex item, relative to the rest of the flex items inside the s
<!DOCTYPE html>
<html>
<head>
<style>
.flex-container {
display: -webkit-flex;
display: flex;
-webkit-justify-content: space-between;
justify-content: space-between;
0. width: 400px;
1. height: 200px;
2. background-color: lightpink;
3. }
4. .flex-item {
5. background-color: brown;
6. width: 100px;
7. height: 100px;
8. margin: 10px;
9. }
0. </ style>
1. </ head>
2. <body>
3. <div class="flex-container">
4. <div class="flex-item">flex item 1</ div>
5. <div class="flex-item">flex item 2</ div>
6. <div class="flex-item">flex item 3</ div>
7. </ div>
8. </ body>
9. </ html>
WEEK 10
Media query
What is Media Query?
CSS Media query is a W3C recommendation and a CSS3 module which is used to adapt
to conditions such as screen resolution (e.g. Smartphone screen vs. computer screen).