Unit I - HTML, CSS, Bootstrap
Unit I - HTML, CSS, Bootstrap
Topic:
Web Essentials and Mark-up
language- HTML
Syllabus
● The Internet, basic internet protocols, the World Wide Web, HTTP Request message, HTTP
response message, web clients, web servers.HTML: Introduction, history and versions.
● HTML elements: headings, paragraphs, line break, colors and fonts, links, frames, lists,
tables, images and forms, Difference between HTML and HTML5. CSS: Introduction to
Style Sheet,
● CSS features, CSS core syntax, Style sheets and HTML, Style rule cascading and
inheritance, text properties.
● Bootstrap
Internet
● The Internet is a vast network that connects computers all over the
world.
● Through the Internet, people can share information and
communicate from anywhere with an Internet connection.
Protocol
HTTP
request line
(GET, POST, GET /somedir/page.html HTTP/1.1
HEAD commands) Host: www.someschool.edu
User-agent: Mozilla/4.0
header Connection: close
lines Accept-language:fr
Carriage return,
line feed (extra carriage return, line feed)
indicates end
of message
HTTP Response Message
HTTP response message example
status line
(protocol
status code HTTP/1.1 200 OK
status phrase) Connection close
Date: Thu, 06 Aug 1998 12:00:15 GMT
header Server: Apache/1.3.0 (Unix)
lines Last-Modified: Mon, 22 Jun 1998 …...
Content-Length: 6821
Content-Type: text/html
data, e.g.,
data data data data data ...
requested
HTML file
Web Client and Web Server
https://hackernoon.com/http-made-easy-understanding-
the-web-client-server-communication-yz783vg3
What is Web Server?
Web Browsers are software installed on your PC. To access the Web you need a web browsers.
Topic:
HTML
Different Web Technologies
● HTML ● SQL
● XHTML ● ASP
● CSS ● ADO
● XML ● PHP
● JavaScript ● .NET
● VBSCRIPT ● SMIL
● DOM ● SVG
● DHTML ● FLASH
● AJAX ● Java applets
● E4X ● Java servlets
● WMLScript ● Java Server Page
List of Technologies
Frameworks Frameworks
● EmberJS ● ExpressJS
● AngularJS
● Django
● ReactJs
● BackboneJS ● laravel
● VueJS ● NodeJS
How to choose a technology?
Depends on:
● What is the type of content?
● Who is your audience?
● Who will modify your content?
● What are your Future Plans?
● Availability of technology?
● Your previous experience?
● Portability and Data sharing
Web - Domain Names & Extension Types
•A domain name is the part of your Internet address that comes after "www". For example, in
Tutorialspoint.com the domain name is tutorialspoint.com.
•.net − Stands for network and is usually used for a network of sites.
•.us, .in − They are based on your country names so that you can go for country specific domain extensions
•.biz − A newer extension on the Internet and can be used to indicate that this site is purely related to business.
HTML
HTML
Version Year
HTML 1991
XHTML 2000
HTML5 2014
HTML Tags
● Headings,
● paragraphs,
● line break,
● Text Formatting (Value Addition)
● colors and fonts,
● links,
● Hyperlink-anchor tag ( Value Addition)
● images
● lists,
● tables,
● frames and forms,
● Span and Div tag ( Value Addition)
HTML- Heading Tags
HTML headings are defined with the <h1> to <h6> tags. <h1> defines the most important heading. <h6> defines
the least important heading:
Output
HTML- Paragraph Tag, Line Break and Horizontal Line
The <a> tag defines a hyperlink, which is used to link from one page to another
Example- target = _blank - Opens the linked document in a new window or tab
HyperLinks
Link to a document called a1.html in the same <a href="a1.html"> Click </a>
directory
Link to a document called a1.html in the subdirectory WTL <a href="WTL/a1.html"> Click </a>
<a href="http://www.snjb.org">Click
Link to an external Web site snjb.org
Here</a>
HyperLinks
Example:-
<a href="#section1">Introduction</a><br>
<a href="#section2">background</a><br>
<h2 id="section1">Introduction</h2>
... Section 1 follows here …
<h2 id="section2">background</h2>
... Section 2 follows here ...
Link tag
<head>
<link rel="stylesheet" href="styles.css">
</head>
The <link> tag defines the relationship between the current document and an external resource.
rel- Required attribute. It specifies the relationship between the current document and the linked document
Images- img tag
<img src= “index.jpeg” alt= “Home page” height= "500" width="600" border= “2”
>
List tag
List
Types
Ordered Unordered Definition
<dl>
<dt>HTML</dt>
<dd>A markup language …</dd>
<dt>CSS</dt>
<dd>Language used to …</dd>
</dl>
HTML Table
Tag Description
<html> <tr>
<body> <td>2</td>
<table border=1 width=50% cellspacing=0> <td>Amit</td>
<td>Pune</td>
<tr> </tr>
<th>RollNo</th>
<th>Name</th> <tr>
<th>Address</th> <td>3</td>
</tr> <td>Neha</td>
<td>Mumbai</td>
<tr> </tr>
<td>1</td>
<td>Bhavana</td> </table>
<td>Nashik</td> </body>
</tr> </html>
HTML Table Example-2
<html>
<body>
<table border=1 width=50% cellspacing=0>
<tr bgcolor=red>
<th>RollNo</th>
<th>Name</th>
<th>Address</th>
</tr>
HTML Table Example-3
<html>
<head>
<style>
tr:nth-child(even)
{ background-color:skyblue; }
</style>
</head>
<body>
HTML Table Example-4
<html>
<body>
<table border=1 width=50% cellspacing=0>
<colgroup>
<col style="background-color:skyblue">
</colgroup>
<tr>
<th>RollNo</th>
<th>Name</th>
<th>Address</th>
</tr>
<tr>
HTML Table Example-6
•The <span> tag is much like the <div> element, but <div> is a block-level
element and <span> is an inline element.
Span and Div tag- Value Addition
<html> <html>
<body> <body>
My mother has <span style="color:blue"> blue My mother has <div style="color:blue"> blue </div>
</span> eyes and my father has <span eyes and my father has <div style= "color:green">
style="color:green">dark green</span> eyes. dark green</div> eyes.
</body> </body>
</html> </html>
Web Technology
Topic:
HTML Frames
HTML Frames
•Example
● A simple three-framed page:
<frameset cols="25%,50%,25%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
● Each <frame> in a <frameset> can have different attributes, such as border,
scrolling, the ability to resize, etc.
Web Technology
Topic:
HTML Forms
HTML Form Example-1-
Login Page
HTML Forms – Example 2 Registration Form
HTML Form Elements
Tag Description
<form> Defines an HTML form for user input
<input> Defines an input control
<textarea> Defines a multiline input control (text area)
<label> Defines a label for an <input> element
<select> Defines a drop-down list
<option> Defines an option in a drop-down list
<button> Defines a clickable button
HTML Input Types
Topic:
Difference Between HTML &
HTML5
Html Html5
DOCTYPE declaration in Html is too longer DOCTYPE declaration in Html5 is very simple "<!DOCTYPE html>
character encoding in Html is also longer character encoding (charset) declaration is also very simple <meta
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 charset="UTF-8">
Transitional//EN">
Audio and Video are not part of HTML4 Audio and Videos are integral part of HTML5 e.g. <audio> and <video> tags.
Vector Graphics is possible with the help of technologies such as Vector graphics is integral part of HTML5 e.g. SVG and canvas
VML, Silverlight, Flash etc
It is almost impossible to get true GeoLocation of user browsing any JS GeoLocation API in HTML5 helps identify location of user browsing any
website especially if it comes to mobile devices. website (provided user allows it)
Not possible to draw shapes like circle, rectangle, triangle. Using Html5 you can draw shapes like circle, rectangle, triangle.
Does not allow JavaScript to run in browser. JS runs in same thread as Allows JavaScript to run in background. This is possible due to JS Web worker
browser interface. API in HTML5
● <mark>
● <audio>
● <video>
● <Progress>
● <nav>
● Canvas
Web Technology
Topic:
CSS- Cascading Style sheet
CSS
CSS
SPV
Selector
Types of CSS
Example:
<p style= “color:red” >
Types of CSS
Internal Example:
CSS <head>
<style>
p { color: red;}
</style>
</head>
Types of CSS
2 Files
1> .html 2> .css
External
CSS Give link of .css file inside .html file,
under head tag, in <link> tag
External CSS Example
a1.html a2.css
<html>
<head>
<link rel="stylesheet" type="text/css" href="a2.css"> p { color: red;}
</head>
<body>
<p> Hello Good Morning </p>
</body> </html>
When to use which Types of CSS
Types of CSS
❏ CSS Color
❏ CSS background
❏ CSS Border
❏ CSS Text
❏ CSS Font
❏ CSS Margin
❏ CSS Padding
❏ CSS Table
CSS Properties- Color
❏color: value
❏Example:
❏color : blue;
CSS Properties-background
● background-color
○ Example:
■ h1 { background-color: green; }
● background-image
○ Example:
■ body { background-image: url("paper.gif"); }
CSS Properties- border
❏ color
❏ background-color
❏ text-alignment (left, right, center, justify)
❏ text-decoration (overline, underline, linethrough)
❏ text-transform (uppercase, lowercase, capitalize)
CSS Properties- Font
❏ Font-family
❏ font-size( in px)
❏ font-weight(normal,bold)
CSS Properties- Margin
❏ margin-top
❏ margin-right
❏ margin-bottom
❏ margin-left
CSS Properties- Padding
❏ padding-top
❏ padding-right
❏ padding-bottom
❏ padding-left
CSS Box Model
CSS Properties- Table
Topic:
Bootstrap
Bootstrap
Bootstrap History
Bootstrap was developed by Mark Otto and Jacob Thornton at Twitter, and released as an
open source product in August 2011 on GitHub.
In June 2014 Bootstrap was the No.1 project on GitHub!
Bootstrap- Advantages
Easy to use: Anybody with just basic knowledge of HTML and CSS can start using Bootstrap
Responsive features: Bootstrap's responsive CSS adjusts to phones, tablets, and desktops
Mobile-first approach: In Bootstrap 3, mobile-first styles are part of the core framework
Browser compatibility: Bootstrap is compatible with all modern browsers (Chrome, Firefox,
Internet Explorer, Safari, and Opera)
Bootstrap Grid
Bootstrap Grid
● If you do not want to use all 12 columns individually, you can group the columns
together to create wider columns
xs
(for phones -
sm
screens less than
768px wide) (for tablets - screens
equal to or greater
md
than 768px wide)
(for small laptops -
lg
screens equal to or
greater than 992px (for laptops and
wide) desktops - screens
equal to or greater
than 1200px wide)
Bootstrap Grid
<div class="row">
<div class="col-*-*"></div>
<div class="col-*-*"></div>
</div>
.col-sm-4 .col-sm-4
.col-sm-4
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4"></div>
<div class="col-sm-4"></div>
</div>
Bootstrap- Where to get?
Websites:
❏ https://www.w3schools.com/html/
❏ https://www.w3schools.com/css/
❏ https://www.w3schools.com/bootstrap/