SlideShare a Scribd company logo
1 of 43
Download to read offline
Hypertext Markup
Language (Part I)
CSC1215 WEB COMPUTING
Learning objectives
At the end of this chapter, student should be able to:
1. Define what is HTML.
2. Create simple code followed by text formatting.
3. Attach any image to the code
Introduction to HTML CSC1215 WEB COMPUTING
You don’t have to be a
Web Ninja to understand
the basics of HTML
Web pages can be created
using HTML code
What does HTML stand
for?
Hyper Text Markup
Language
Introduction
standard markup
language for
creating Web pages.
Describes the
structure of a Web
page
consists of a series
of elements.
The elements tell
the browser how to
display the content.
Introduction
▪ HTML is a clickable text that consist of a special codes that are used to
define the placement and format of text, graphics, video and sound on a web
page.
▪ HTML is a programming language that places codes or tags in a web
document, providing information to browser about the structure of the
document.
HTML
Page
Structure
A simple HTML Document
HTML Documents
❑ All HTML documents must start with a document type declaration: <!DOCTYPE html>.
❑ The HTML document itself begins with <html> and ends with </html>.
❑ The visible part of the HTML document is between <body> and </body>.
What is an HTML Element?
❑ An HTML element is defined by a start tag, some content, and an end tag:
<tagname> Content goes here </tagname>
❑ The HTML element is everything from the start tag to the end tag:
<h1> My First Heading </h1>
<p> My first paragraph </p>
Text Formatting CSC1215 WEB COMPUTING
HTML Headings
❑ HTML headings are titles or subtitles that you
want to display on a webpage.
❑ HTML headings are defined with the <h1>to
<h6> tags.
<h1> defines the most important heading.
<h6> defines the least important heading.
HTML Headings
❑ Bigger Headings
❑ Each HTML heading has a default size.
However, you can specify the size for any heading
with the style attribute, using the CSS font-size
property:
<h1 style="font-size:60px;"> Heading 1 </h1>
HTML
Paragraphs
❑ The HTML <p>element defines a paragraph.
❑ A paragraph always starts on a new line, and
browsers automatically add some white space (a
margin) before and after a paragraph.
<p> This is a paragraph </p>
<p> This is another paragraph </p>
HTML Horizontal Rules
❑ The <hr> tag defines a thematic break in an HTML page and is
most often displayed as a horizontal rule.
❑ The <hr> element is used to separate content (or define a
change) in an HTML page:
<h1> This is heading 1 </h1>
<p> This is some text </p>
<hr>
<h2> This is heading 2 </h2>
<p> This is some other text </p> <hr>
HTML Line Breaks
❑ The HTML <br> element defines a line break.
❑ Use <br> if you want a line break (a new line) without
starting a new paragraph:
<p> This is <br> a paragraph <br> with line breaks.</p>
The HTML <pre> Element
❑ The HTML <pre> element defines preformatted text.
❑ The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it
preserves both spaces and line breaks:
<pre>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</pre>
HTML Style
❑ The HTML <style> attribute is used to add styles to an element, such as
color, font, size, and more.
❑ Setting the style of an HTML element, can be done with the style
attribute.
❑ The HTML style attribute has the following syntax:
<p> I am normal </p>
<p style="color:red;"> I am red </p>
<p style="color:blue;"> I am blue </p>
<p style="font-size:50px;"> I am big </p>
<p style=“color:read; font-size:50px;”>I am Anis</p>
Background Color
❑ The CSS background-colorproperty defines the
background color for an HTML element.
<body style="background-color:powderblue;">
</body>
<p style="background-color:tomato;">This is a
paragraph </p>
Text Color
❑ The CSS colorproperty defines the text color for an HTML
element:
<h1 style="color:blue;"> This is a heading </h1>
<p style="color:red;"> This is a paragraph </p>
Combine
<body style="background-color:powderblue;">
<p style="background-color:tomato;"> This is a
paragraph </p>
<h1 style="color:blue;"> This is a heading </h1>
<p style="color:red;"> This is a paragraph </p>
</body>
Font
❑ The CSS font-familyproperty defines the font to
be used for an HTML element:
<h1 style="font-family:verdana;"> This is a
heading </h1>
<p style="font-family:courier;"> This is a
paragraph </p>
Text Size
❑ The CSS font-size property defines the text size for
an HTML element:
<h1 style="font-size:300%;"> This is a heading
</h1>
<p style="font-size:160%;"> This is a paragraph </p>
Text Alignment
❑ The CSS text-align property defines the horizontal text
alignment for an HTML element:
<h1 style="text-align: center;"> Centered Heading </h1>
<p style="text-align: right;"> Right paragraph </p>
HTML Text
Formatting
❑ HTML contains several elements for defining text with a special
meaning.
❑ Formatting elements were designed to display special types of
text.
<p><b> This text is bold </b></p>
<p><i> This text is italic </i></p>
<p><u> This text is underline </u></p>
<p> This is <sub> subscript</sub> and <sup> superscript
</sup></p>
HTML Text Formatting
HTML Quotation and Citation
HTML Quotation and Citation
<p> WWF's goal is to: <q> Build a future where people live in harmony with nature. </q></p>
<p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p>
<address>
Written by John Doe.<br>
Visit us at:<br>
Example.com<br>
Box 564, Disneyland<br>USA
</address>
<p><cite> The Scream </cite> by Edvard Munch. Painted in 1893.</p>
<bdo dir="rtl"> This line will be written from right to left </bdo>
HTML Image CSC1215 WEB COMPUTING
HTML Image
❑ Images can improve the design and the appearance of a web page.
❑ The HTML <img> tag is used to embed an image in a web page.
❑ Images are not technically inserted into a web page; images are linked to web pages.
❑ The <img> tag creates a holding space for the referenced image.
❑ The <img> tag is empty, it contains attributes only, and does not have a closing tag.
❑ The <img> tag has two required attributes:
src - Specifies the path to the image
alt - Specifies an alternate text for the image
The src Attribute
❑ The required srcattribute specifies the path (URL) to the image.
<img src=“image.jpg" alt=“HTML Image“>
❑ Note: When a web page loads; it is the browser, at that moment, that gets the image from a web
server and inserts it into the page. Therefore, make sure that the image actually stay in the same
spot in relation to the web page, otherwise your visitors will get a broken link icon. The broken link
icon is shown if the browser cannot find the image.
The alt Attribute
❑ The required alt attribute provides an alternate text for an image, if the user for some reason
cannot view it(because of slow connection, an error in the src attribute, or if the user uses a
screen reader).
❑ The value of the alt attribute should describe the image.
❑ If a browser cannot find an image, it will display the value of the alt attribute.
Image Size – Height and Width
❑ You can use the style attribute to specify the width and height of an image. The value of the alt
attribute should describe the image.
<img src=“image.jpg" alt=“HTML Image“ width="500" height="600">
❑ The width, height, and style attributes are all valid in HTML.
Image Location
Images in Another Folder
❑ If you have your images in a sub-folder, you must include the folder name in the src attribute:
<img src="/web/image.jpg" alt="HTML Image">
Images on Another Server
❑ Some web sites store their images on another server.
❑ Actually, you can access images from any web address in the world:
<img src="https://www.w3schools.com/images/logo.jpg" alt="W3Schools.com">
Image Format
Here are the most common image file types, which are supported in all browser (Chrome, Edge, Firefox,
Safari, Opera)
Background Image on a Page
If you want the entire page to have a background image, you must specify the background image
on the <body> element:
<style>
body
{
background-image: url('image.jpg’);
}
</style>
IMPORTANT
✓Make sure the images and html file are located in the
same folder !
✓Otherwise use the path directory where the images
are located.
Conclusions
1. HTML is HyperText Markup Language
2. Define the document type of HTML at the beginning of the code <!doctype html>
3. In HTML code structure should include <head>, <body> with open and close tag
4. Image can be attach by calling out the <src image> with its path location
LAB 1 CSC1215 WEB COMPUTING

More Related Content

Similar to HTML Elements and Formatting

wd project.pptx
wd project.pptxwd project.pptx
wd project.pptxdsffsdf1
 
4_5926925443935505826.pptx
4_5926925443935505826.pptx4_5926925443935505826.pptx
4_5926925443935505826.pptxLusi39
 
BVK_PTT_HTML-Unit - III (1).pptx
BVK_PTT_HTML-Unit - III (1).pptxBVK_PTT_HTML-Unit - III (1).pptx
BVK_PTT_HTML-Unit - III (1).pptxpanoosha2
 
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptxDESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptxbmit1
 
web development.pdf
web development.pdfweb development.pdf
web development.pdfBagHarki
 
HTML FOR BEGINNERS AND FOR PRACTICE .pdf
HTML FOR BEGINNERS AND FOR PRACTICE .pdfHTML FOR BEGINNERS AND FOR PRACTICE .pdf
HTML FOR BEGINNERS AND FOR PRACTICE .pdfArun Karthik
 
Images and Lists in HTML
Images and Lists in HTMLImages and Lists in HTML
Images and Lists in HTMLMarlon Jamera
 
AttributesL3.pptx
AttributesL3.pptxAttributesL3.pptx
AttributesL3.pptxKrishRaj48
 
Hypertext_markup_language
Hypertext_markup_languageHypertext_markup_language
Hypertext_markup_languageIshaq Shinwari
 
Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)ghayour abbas
 
In Class Assignment 1 .docx
In Class Assignment 1                                        .docxIn Class Assignment 1                                        .docx
In Class Assignment 1 .docxjaggernaoma
 

Similar to HTML Elements and Formatting (20)

Lab_Ex1.pptx
Lab_Ex1.pptxLab_Ex1.pptx
Lab_Ex1.pptx
 
wd project.pptx
wd project.pptxwd project.pptx
wd project.pptx
 
Lab1_HTML.pptx
Lab1_HTML.pptxLab1_HTML.pptx
Lab1_HTML.pptx
 
4_5926925443935505826.pptx
4_5926925443935505826.pptx4_5926925443935505826.pptx
4_5926925443935505826.pptx
 
BVK_PTT_HTML-Unit - III (1).pptx
BVK_PTT_HTML-Unit - III (1).pptxBVK_PTT_HTML-Unit - III (1).pptx
BVK_PTT_HTML-Unit - III (1).pptx
 
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptxDESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
 
web development.pdf
web development.pdfweb development.pdf
web development.pdf
 
HTML FOR BEGINNERS AND FOR PRACTICE .pdf
HTML FOR BEGINNERS AND FOR PRACTICE .pdfHTML FOR BEGINNERS AND FOR PRACTICE .pdf
HTML FOR BEGINNERS AND FOR PRACTICE .pdf
 
Images and Lists in HTML
Images and Lists in HTMLImages and Lists in HTML
Images and Lists in HTML
 
Html cia
Html ciaHtml cia
Html cia
 
AttributesL3.pptx
AttributesL3.pptxAttributesL3.pptx
AttributesL3.pptx
 
HTML PPT.pdf
HTML PPT.pdfHTML PPT.pdf
HTML PPT.pdf
 
HTML Coding
HTML CodingHTML Coding
HTML Coding
 
Hypertext_markup_language
Hypertext_markup_languageHypertext_markup_language
Hypertext_markup_language
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshop
 
html.pptx
html.pptxhtml.pptx
html.pptx
 
Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
Css introduction
Css  introductionCss  introduction
Css introduction
 
In Class Assignment 1 .docx
In Class Assignment 1                                        .docxIn Class Assignment 1                                        .docx
In Class Assignment 1 .docx
 

More from AnisZahirahAzman (15)

Chapter 6.pdf
Chapter 6.pdfChapter 6.pdf
Chapter 6.pdf
 
Chapter 4.pdf
Chapter 4.pdfChapter 4.pdf
Chapter 4.pdf
 
Chapter 10.pdf
Chapter 10.pdfChapter 10.pdf
Chapter 10.pdf
 
Chapter 3.pdf
Chapter 3.pdfChapter 3.pdf
Chapter 3.pdf
 
Chapter 2.pdf
Chapter 2.pdfChapter 2.pdf
Chapter 2.pdf
 
Chapter 1.pdf
Chapter 1.pdfChapter 1.pdf
Chapter 1.pdf
 
Chapter 1.pdf
Chapter 1.pdfChapter 1.pdf
Chapter 1.pdf
 
Chapter 1.pdf
Chapter 1.pdfChapter 1.pdf
Chapter 1.pdf
 
Chapter 13.pptx
Chapter 13.pptxChapter 13.pptx
Chapter 13.pptx
 
IoT Protocol Stack.pdf
IoT Protocol Stack.pdfIoT Protocol Stack.pdf
IoT Protocol Stack.pdf
 
Chapter 9.pptx
Chapter 9.pptxChapter 9.pptx
Chapter 9.pptx
 
connecting smart object in IoT.pptx
connecting smart object in IoT.pptxconnecting smart object in IoT.pptx
connecting smart object in IoT.pptx
 
Chapter 5.pptx
Chapter 5.pptxChapter 5.pptx
Chapter 5.pptx
 
introduction to c.pptx
introduction to c.pptxintroduction to c.pptx
introduction to c.pptx
 
component of c language.pptx
component of c language.pptxcomponent of c language.pptx
component of c language.pptx
 

Recently uploaded

AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneCall girls in Ahmedabad High profile
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 

Recently uploaded (20)

AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 

HTML Elements and Formatting

  • 1. Hypertext Markup Language (Part I) CSC1215 WEB COMPUTING
  • 2. Learning objectives At the end of this chapter, student should be able to: 1. Define what is HTML. 2. Create simple code followed by text formatting. 3. Attach any image to the code
  • 3. Introduction to HTML CSC1215 WEB COMPUTING
  • 4. You don’t have to be a Web Ninja to understand the basics of HTML
  • 5. Web pages can be created using HTML code
  • 6. What does HTML stand for?
  • 8. Introduction standard markup language for creating Web pages. Describes the structure of a Web page consists of a series of elements. The elements tell the browser how to display the content.
  • 9. Introduction ▪ HTML is a clickable text that consist of a special codes that are used to define the placement and format of text, graphics, video and sound on a web page. ▪ HTML is a programming language that places codes or tags in a web document, providing information to browser about the structure of the document.
  • 11. A simple HTML Document
  • 12. HTML Documents ❑ All HTML documents must start with a document type declaration: <!DOCTYPE html>. ❑ The HTML document itself begins with <html> and ends with </html>. ❑ The visible part of the HTML document is between <body> and </body>.
  • 13. What is an HTML Element? ❑ An HTML element is defined by a start tag, some content, and an end tag: <tagname> Content goes here </tagname> ❑ The HTML element is everything from the start tag to the end tag: <h1> My First Heading </h1> <p> My first paragraph </p>
  • 14. Text Formatting CSC1215 WEB COMPUTING
  • 15. HTML Headings ❑ HTML headings are titles or subtitles that you want to display on a webpage. ❑ HTML headings are defined with the <h1>to <h6> tags. <h1> defines the most important heading. <h6> defines the least important heading.
  • 16. HTML Headings ❑ Bigger Headings ❑ Each HTML heading has a default size. However, you can specify the size for any heading with the style attribute, using the CSS font-size property: <h1 style="font-size:60px;"> Heading 1 </h1>
  • 17. HTML Paragraphs ❑ The HTML <p>element defines a paragraph. ❑ A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and after a paragraph. <p> This is a paragraph </p> <p> This is another paragraph </p>
  • 18. HTML Horizontal Rules ❑ The <hr> tag defines a thematic break in an HTML page and is most often displayed as a horizontal rule. ❑ The <hr> element is used to separate content (or define a change) in an HTML page: <h1> This is heading 1 </h1> <p> This is some text </p> <hr> <h2> This is heading 2 </h2> <p> This is some other text </p> <hr>
  • 19. HTML Line Breaks ❑ The HTML <br> element defines a line break. ❑ Use <br> if you want a line break (a new line) without starting a new paragraph: <p> This is <br> a paragraph <br> with line breaks.</p>
  • 20. The HTML <pre> Element ❑ The HTML <pre> element defines preformatted text. ❑ The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks: <pre> My Bonnie lies over the ocean. My Bonnie lies over the sea. My Bonnie lies over the ocean. Oh, bring back my Bonnie to me. </pre>
  • 21. HTML Style ❑ The HTML <style> attribute is used to add styles to an element, such as color, font, size, and more. ❑ Setting the style of an HTML element, can be done with the style attribute. ❑ The HTML style attribute has the following syntax: <p> I am normal </p> <p style="color:red;"> I am red </p> <p style="color:blue;"> I am blue </p> <p style="font-size:50px;"> I am big </p> <p style=“color:read; font-size:50px;”>I am Anis</p>
  • 22. Background Color ❑ The CSS background-colorproperty defines the background color for an HTML element. <body style="background-color:powderblue;"> </body> <p style="background-color:tomato;">This is a paragraph </p>
  • 23. Text Color ❑ The CSS colorproperty defines the text color for an HTML element: <h1 style="color:blue;"> This is a heading </h1> <p style="color:red;"> This is a paragraph </p>
  • 24. Combine <body style="background-color:powderblue;"> <p style="background-color:tomato;"> This is a paragraph </p> <h1 style="color:blue;"> This is a heading </h1> <p style="color:red;"> This is a paragraph </p> </body>
  • 25. Font ❑ The CSS font-familyproperty defines the font to be used for an HTML element: <h1 style="font-family:verdana;"> This is a heading </h1> <p style="font-family:courier;"> This is a paragraph </p>
  • 26. Text Size ❑ The CSS font-size property defines the text size for an HTML element: <h1 style="font-size:300%;"> This is a heading </h1> <p style="font-size:160%;"> This is a paragraph </p>
  • 27. Text Alignment ❑ The CSS text-align property defines the horizontal text alignment for an HTML element: <h1 style="text-align: center;"> Centered Heading </h1> <p style="text-align: right;"> Right paragraph </p>
  • 28. HTML Text Formatting ❑ HTML contains several elements for defining text with a special meaning. ❑ Formatting elements were designed to display special types of text. <p><b> This text is bold </b></p> <p><i> This text is italic </i></p> <p><u> This text is underline </u></p> <p> This is <sub> subscript</sub> and <sup> superscript </sup></p>
  • 30. HTML Quotation and Citation
  • 31. HTML Quotation and Citation <p> WWF's goal is to: <q> Build a future where people live in harmony with nature. </q></p> <p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p> <address> Written by John Doe.<br> Visit us at:<br> Example.com<br> Box 564, Disneyland<br>USA </address> <p><cite> The Scream </cite> by Edvard Munch. Painted in 1893.</p> <bdo dir="rtl"> This line will be written from right to left </bdo>
  • 32.
  • 33. HTML Image CSC1215 WEB COMPUTING
  • 34. HTML Image ❑ Images can improve the design and the appearance of a web page. ❑ The HTML <img> tag is used to embed an image in a web page. ❑ Images are not technically inserted into a web page; images are linked to web pages. ❑ The <img> tag creates a holding space for the referenced image. ❑ The <img> tag is empty, it contains attributes only, and does not have a closing tag. ❑ The <img> tag has two required attributes: src - Specifies the path to the image alt - Specifies an alternate text for the image
  • 35. The src Attribute ❑ The required srcattribute specifies the path (URL) to the image. <img src=“image.jpg" alt=“HTML Image“> ❑ Note: When a web page loads; it is the browser, at that moment, that gets the image from a web server and inserts it into the page. Therefore, make sure that the image actually stay in the same spot in relation to the web page, otherwise your visitors will get a broken link icon. The broken link icon is shown if the browser cannot find the image.
  • 36. The alt Attribute ❑ The required alt attribute provides an alternate text for an image, if the user for some reason cannot view it(because of slow connection, an error in the src attribute, or if the user uses a screen reader). ❑ The value of the alt attribute should describe the image. ❑ If a browser cannot find an image, it will display the value of the alt attribute.
  • 37. Image Size – Height and Width ❑ You can use the style attribute to specify the width and height of an image. The value of the alt attribute should describe the image. <img src=“image.jpg" alt=“HTML Image“ width="500" height="600"> ❑ The width, height, and style attributes are all valid in HTML.
  • 38. Image Location Images in Another Folder ❑ If you have your images in a sub-folder, you must include the folder name in the src attribute: <img src="/web/image.jpg" alt="HTML Image"> Images on Another Server ❑ Some web sites store their images on another server. ❑ Actually, you can access images from any web address in the world: <img src="https://www.w3schools.com/images/logo.jpg" alt="W3Schools.com">
  • 39. Image Format Here are the most common image file types, which are supported in all browser (Chrome, Edge, Firefox, Safari, Opera)
  • 40. Background Image on a Page If you want the entire page to have a background image, you must specify the background image on the <body> element: <style> body { background-image: url('image.jpg’); } </style>
  • 41. IMPORTANT ✓Make sure the images and html file are located in the same folder ! ✓Otherwise use the path directory where the images are located.
  • 42. Conclusions 1. HTML is HyperText Markup Language 2. Define the document type of HTML at the beginning of the code <!doctype html> 3. In HTML code structure should include <head>, <body> with open and close tag 4. Image can be attach by calling out the <src image> with its path location
  • 43. LAB 1 CSC1215 WEB COMPUTING