0% found this document useful (0 votes)
17 views4 pages

Lecture 3

The document provides a lecture on HTML text formatting, covering how to make text bold, italic, or underlined using specific tags. It also explains how to set background and text colors using the bgcolor attribute and lists various color names and their hexadecimal codes. Examples of HTML code are included to illustrate these concepts.

Uploaded by

aregadaniel9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views4 pages

Lecture 3

The document provides a lecture on HTML text formatting, covering how to make text bold, italic, or underlined using specific tags. It also explains how to set background and text colors using the bgcolor attribute and lists various color names and their hexadecimal codes. Examples of HTML code are included to illustrate these concepts.

Uploaded by

aregadaniel9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

HTML Lecture

Today we will discuss about formatting the text on the browser. That is
 How to make our text appear as bold, italic or underlined
 To set the page color, i.e. background color and Text color
Formatting the text
The following are the tags for bold, underline, italic
<b> </b> for bold
<u> </u> for underline
<i> </i> for italic

Let us look at an example


<html>
<head>
<title>Welcome to my Home Page</title>
</head>
<body>
My name is <b>Harshit Kumar</b>.<br>
I am </i> at <u>University of Suwon</u>.<br>
My major is <i>computer science</i>
</body>
</html>

The output will be


My name is Harshit Kumar.
I am at University of Suwon.
My major is computer science

Q) What is the output of the following code?


html>
<head>
<title>Welcome to my Home Page</title>
</head>
<body>
My name is <b><u><i>Harshit Kumar</b></u></i>.
</body>
</html>

A)

Q) What is the default background color of webpage?


A) White.

Q) How can I change the background color of a web page?


A) We can change the background color of a web page by using bgcolor attribute of
<body> tag.
Let us discuss an example to understand this
Write the code below and save as an .html file.

<html>
<head>
<title>Welcome to my Home Page</title>
</head>
<body bgcolor="blue">
My name is Harshit Kumar

</body>
</html>

The output is

The text color can also be changed, i.e. we can change the background color and text
color.
Write the code below and save as an .html file.
<html>
<head>
<title>Welcome to my Home Page</title>
</head>
<body bgcolor="black" text="yellow">
My name is Harshit Kumar

</body>
</html>

The output is

If you put <body bgcolor=”black”> or


<body bgcolor=”#FFE4C4”>, then you will get the same effect on the page color, i.e.
background color will be black. The # tells the browser that the number is hexadecimal.
bgcolor="red" bgcolor="#FF0000"

Similarly, by using the colour name or the code shown in the following table, you will get
the same colour results;

aliceblue antiquewhite aqua aquamarine


Code=#F0F8FF #FAEBD7 #00FFFF #7FFFD4
azure beige bisque black
#F0FFFF #F5F5DC #FFE4C4 #FFE4C4
blanchedalmond blue blueviolet brown
#FFEBCD #0000FF #8A2BE2 #A52A2A
burlywood cadetblue chartreuse chocolate
#DEB887 #5F9EA0 #7FFF00 #D2691E
coral cornflowerblue cornsilk crimson
#FF7F50 #6495ED #FFF8DC #DC143C
cyan darkblue darkcyan darkgoldenrod
#00FFFF #00008B #008B8B #B8860B
darkgray darkgray darkkhaki darkmagenta
#A9A9A9 #A9A9A9 #BDB76B #8B008B
darkolivegreen darkorange darkorchid darkred
#556B2F #FF8C00 #9932CC #8B0000
darksalmon darkseagreen darkslateblue darkslategray
#E9967A #8FBC8F #483D8B #2F4F4F
darkturquoise darkviolet deeppink deepskyblue
#00CED1 #9400D3 #FF1493 #00BFFF
dimgray dodgerblue firebrick floralwhite
#696969 #1E90FF #B22222 #FFFAF0
forestgreen fuchsia gainsboro ghostwhite
#228B22 #FF00FF #DCDCDC #F8F8FF
gold goldenrod gray green
#FFD700 #DAA520 #808080 #008000
greenyellow honeydew hotpink indianred
#ADFF2F #F0FFF0 #FF69B4 #CD5C5C
indigo ivory khaki lavender
#4B0082 #FFFFF0 #F0E68C #E6E6FA
lavenderblush lawngreen lemonchiffon lightblue
#FFF0F5 #7CFC00 #FFFACD #ADD8E6
lightcoral lightcyan lightgoldenrodyellow lightgreen
#F08080 #E0FFFF #FAFAD2 #90EE90
lightgrey lightpink lightsalmon lightseagreen
#D3D3D3 #FFB6C1 #FFA07A #20B2AA
lightskyblue lightslategray lightsteelblue lightyellow
#87CEFA #778899 #B0C4DE #FFFFE0
lime limegreen linen magenta
#00FF00 #32CD32 #FAF0E6 #FF00FF
maroon mediumaquamarine mediumblue mediumorchid
#800000 #66CDAA #0000CD #BA55D3
mediumpurple mediumseagreen mediumslateblue mediumspringgreen
#9370DB #3CB371 #7B68EE #00FA9A
mediumturquoise mediumvioletred midnightblue mintcream
#48D1CC #C71585 #191970 #F5FFFA
mistyrose moccasin navajowhite navy
#FFE4E1 #FFE4B5 #FFDEAD #000080
oldlace olive olivedrab orange
#FDF5E6 #808000 #6B8E23 #FFA500
orangered orchid palegoldenrod palegreen
#FF4500 #DA70D6 #EEE8AA #98FB98
paleturquoise palevioletred papayawhip peachpuff
#AFEEEE #DB7093 #FFEFD5 #FFDAB9
peru pink plum powderblue
#CD853F #FFC0CB #DDA0DD #B0E0E6
purple red rosybrown royalblue
#800080 #FF0000 #BC8F8F #4169E1
saddlebrown salmon sandybrown seagreen
#8B4513 #FA8072 #F4A460 #2E8B57
seashell sienna silver skyblue
#FFF5EE #A0522D #C0C0C0 #87CEEB
slateblue slategray snow springgreen
#6A5ACD #6A5ACD #FFFAFA #00FF7F
steelblue tan teal thistle
#4682B4 #D2B48C #008080 #D8BFD8
tomato turquoise violet wheat
#FF6347 #40E0D0 #EE82EE #F5DEB3
white yellow yellowgreen
#FFFFFF #FFFF00 #9ACD32

You might also like