1bcom_sem3_unit4_notes
1bcom_sem3_unit4_notes
1
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
Every HTML document starts with <html> and ends with </html>. The starting <html> tag tells the
browser where the document start and ending </html> tag tell the browser where the document ends.
All HTML documents contain 2 sections. They are
◦ Head section
◦ Body section
1. Head section:
The document head section shows the information of the document. It is represented by starting
<head> and ending </head> tag. The head section contains only one tag called <title> tag which is used
to display the title of the document in the browser window.
Ex: <title> tag, <meta> tag, <script> tag, <style> tag etc.
2. Body section:
The body section is used to display main information (i.e., text or images) of the document. It is
represented by starting <body> and closing </body> tag. It contains all the HTML content like headings,
paragraphs, images, hyperlinks, tables etc.
Ex: heading tags (<h1>,<h2>,<h4>,<h4>,<h5>,<h6>), paragraph tags (<p>), table (<table>,<tr>,<td>) tags
etc
Example:
<html>
2
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
<head>
<title>First html program</title>
</head>
<body>
<h1>HTML </h1>
<p>Welcome to the web page</p>
</body>
</html>
Example:
<html> <body>
<b>This is bold text</b><br>
3
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
Example: <h1>HTML</h1>
<h21 align=“center”> HTML </h2>
Here, align specifies the alignment of the horizontal rule, width specifies the width and size specifies
height of the horizontal rule,
1. Unordered lists:
An unordered list is a collection of related items that have no special order or sequence. It is created by
using <ul> tag. Each list item in the list starts with the list tag <li>. By default unordered list displays the
text with a bullet (or) Disc.
Syntax:
<ul type=” Disc” |”Circle” |”Square”>
……………
</ul>
Example:
5
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
<html><body>
<p>BSC Courses
<ul type=disc>
<li>B .Com
<li>B.Sc
<li>B.C.A
<li>B B.A
</ul>
</p></body></html>
2. Ordered lists:
In ordered list, the list items are numbered instead of bulleted. The ordered list is created by using <ol>
tag. Each list item in the list starts with the list tag <li>. By default unordered list displays the text with a
number.
Syntax:
<ol type=”1” | ”A” |”I” |”a” |”i” start=”n”>
…………….
</ol>
Example:
<html>
<body>
<p>BSC Courses
<ol>
<li>MSCS
<li>MECS
<li>MPCS
</ol>
</p></body></html>
3. Definition lists:
HTML also supports a list style where the data is displayed with specific style. HTML and XHTML
supports a list style which is called definition lists where entries are listed like in a dictionary or
encyclopedia. The definition list is the ideal way to present a glossary, list of terms, or other name/value
list.
The Definition list is created by using <dl> tag and it contains two parts - definition term <dt> and
definition data<dd>.
Syntax:
<dl>
<dt>……………. </dt>
<dd>………….…..</dd>
</dl>
6
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
Example:
<html><body>
<p>Definition List
<dl>
<dt>HTML</dt>
<dd>HTML stands for Hyper Text Markup Language</dd>
</dl>
</p></body></html>
Types of hyperlinks:
1. Clickable Text Hyperlinks:
A Hyperlink is created to the selected text written between <a>….</a> tag. By clicking on the text, the
web page is connected to the given location dynamically.
Example:
<html><body>
<a href="sample.html>Click here</a>
</body></html>
3. Mailto hyperlinks
These are used to add Mailto hyperlink to a webpage. This provides a method to send you an e-mail by
opening a default mailbox with the given mail id in the sender URL.
Example:
<html><body>
<a href=mailto:nlucky676@gmail.com>Contact Me</a>
7
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
</body></html>
1. Creating Tables:
In HTML, tables are created using <table> …….. </table> tag. In the table, rows are specified by <tr>
(table row) tag and columns by <td> (table data) tag.
Syntax:
<table border=”n”
align=”center” | “left” | “right”
bordercolor=”#rrggbb”
width=”n” | “nn%”
background=”filename”
bgcolor=”#rrggbb”
valign=”top” | “bottom”
cellpadding=”n”
cellspacing=”n”>
…………….
</table>
Where,
1. Border: It specifies the thickness of the border.
2. Width: It specifies the width of the table.
3. Height: It specifies the height of the table.
4. Align: it is used to align a table in a web page.
5. Cellpadding: It specifies the amount of space between cell content and cell border.
6. Cellspacing: It specifies the space between the cells and b/w the cell border and table border.
7. Bordercolor: specifies the color of the border to be displayed
8. Align: This attribute can be used to align a table in a web page.
9. Bgcolor: This attribute specifies a background for the table.
10. Background: This attribute is used to display an image the background to be table.
8
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
The <td> and <th> tags are used to create a columns in a particular row. The <td> tag is used to create a
column in a particular row and display the data in normal font. The <th> tag is used to create a header
displayed with bold style and the text will be centered.
Syntax: <td align=”center” | “left” | “right” colspan=”n” rowspan=”n” > …………. </td>
Where, the rowspan attribute is used to span (merge) the cells vertically and colspan attribute is used to
span (merge) the cells horizontally.
Example: rowspan
<html><body>
<table border=1>
<tr> <th rowspan="3">Address</th>
<th>DNO</th>
<td>14/821</td>
</tr>
<tr> <th>Street</th>
<td>Opp. Post office</td>
</tr>
<tr> <th>Village</th>
<td>Kamalapuram</td>
</tr>
</table></body></html>
Example: Colspan
<html><body>
<table border=1>
<tr> <th colspan="3">Educational Qualifications</tr>
<th>Degree
<th>College/School
<th>Year
</tr>
<tr> <td>PG
<td>SVDC,Kadapa
<td>2013
</tr>
<tr> <td>Degree
<td>CSSR&SRRM DC,Kamalapuram
<td>2010
</tr>
</table></body></html>
9
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
Where
1) src - specifies the source or path of the image.
2) alt - defines an alternate text for the image,
3) width - specify the width of the image.
4) height - specify the height of the image.
5) Hspace(Horizontal Space): specifies the amount of space empty space on the left and right sides of the
image.
6) VSpace(vertical space): specifies the amount of empty space on the top and bottom of the image.
Example:
<html><body>
<img src="animal.jpg" height="180" width="300" alt="animal image">
</body></html>
10
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
The document head section shows the information of the document. It is represented by starting <head>
and ending </head> tag. The head section contains only one tag called <title> tag which is used to display
the title of the document in the browser window.
5. Global links:
<link> - It is used to allow other documents to be linked to (or included in ) the current document
and an external resource
Syntax: <link rel=”type” href=”URL” type=”string”>
Example: <link rel=”stylesheet” href=”style.css” type=”text/css”>
11
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
Example:
<BODY BGCOLOR = "white" TEXT = "black" LINK = "blue" VLINK = "purple" ALINK = "red"
BACKGROUND=”c:\clouds.jpg>
1. Color Names
We define color by specifying directly a color name to text. The 16 standard colors names
Black,Gray,Silver,White,Yellow,Lime,Aqua,Fuchsia,Red,Green,Blue,Purple,Maroon,Olive Navy, Teal
Example:
<html>
<body text="blue" bgcolor="green">
<h1>Colors</h1>
<p><font color=green>Green text</font></p>
</body>
</html>
2. Hex Codes
HTML colors are defined using a hexadecimal notation (HEX) for the combination of Red, Green,
and Blue color values (RGB). A hexadecimal is a 6 digit representation of a color.
Each hexadecimal code values are specified as 3 pairs of two-digit numbers, starting with a pound
or hash sign #. The combination of Red, Green, and Blue values from 0 to 255, gives more than 16
million different colors (256 x 256 x 256).
Example:
<html>
<body text="#0000FF" bgcolor="#00FF00">
<h1>Colors</h1>
<p><font color="#FFFFFF">Some colored text text</font></p>
12
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
</body>
</html>
3. RGB Values
This color value is specified using the rgb( ) property. This property takes three values, one each for red,
green, and blue. The value can be an integer between 0 and 255 or a percentage.
Example:
<html>
<body text="rgb(0,0,255)" bgcolor="rgb(0,255,0)">
<h1>Colors</h1>
<p><font color="rgb(255,255,255)">Some colored text</font></p>
</body>
</html>
13
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
History of HTML:
CSS Preview:
CSS Preview is a tool for previewing selected CSS selectors in a separate column inside the vscode
editor.
The purpose of the tool is to give you a visual idea of your styling without leaving your editor.
CSS Preview enables you to see a visual representation of your styled selectors without leaving
your editor.
All the changes made in the CSS file editor are automatically reflected in the CSS preview, which is
based on the Google Chrome browser.
To preview a CSS file in the CSS Preview, choose a CSS file in the Project Explorer view, open the
context menu, and select Preview or use the Ctrl + 4 hotkey.
14
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
Example:
15
E-Commerce & Web Designing I BCOM – Semester – 3(2024)
16