Internet & Web Engineering Course Code:CS-228 Credit Hours (3+1) Lab 1 Introduction to Markup Language HTML Instructor: Muhammad Zeeshan Haider.

Slides:



Advertisements
Similar presentations
HTML popo.
Advertisements

Presenter: James Huang Date: Sept. 26,  Introduction  Basics  Lists  Links  Forms  CSS 2.
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
1 Outline 9.1Introduction 9.2Markup Languages 9.3Editing HTML 9.4Common Tags 9.5Headers 9.6Text Styling 9.7Linking 9.8Images 9.9Formatting Text With 9.10Special.
4.01 Cascading Style Sheets
HTML BASIC
HTML. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is a markup language A markup language.
Headings, Paragraphs, Formatting, Links, Head, CSS, Images
HTML HTML stands for "Hyper Text Mark-up Language“. Technically, HTML is not a programming language, but rather a markup language. Used to create web pages.
Learning HTML. HTML Attributes HTML elements can have attributes Attributes provide additional information about an element Class – specifies a class.
ACM 511 HTML Week -1 ACM 511 Course Notes. Books ACM 511 Course Notes.
1 eVenzia Technologies Learning HTML, XHTML & CSS Chapter 2.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Introduction to HTML. HTML Hyper Text Markup Language Page Title My First Heading My first paragraph. Page Title My First Heading My first paragraph.
CHAPTER 1 HTML & HTML5 I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
CSS Basic (cascading style sheets)
Introduction to HTML Xiangming Mu 9/23/ Learning Objectives Understand basic HTML tags and their attributes Learn to create a simple HTML page.
HTML HyperText Markup Language ©Richard L. Goldman July 15, 2003.
HTML Basics Computers. What is an HTML file? *HTML is a format that tells a computer how to display a web page. The documents themselves are plain text.
WEEK -1 ACM 262 ACM 262 Course Notes. HTML What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
HTML. INDEX Introduction to HTML Creating Web Pages Commands And Tags Web Page.
Chapter 1: Intro to HTML Section 1: HTML Structure Presentation Section 2: Layout of an HTML File Section 3: Working with Lists & Tables Section 4: HTML.
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
Introduction to Programming
Lab 3 Html basics.
Fall 2016 CSULA Saloni Chacha
IS1500: Introduction to Web Development
Cascading Style Sheet.
HTML.
INTRO TO WEB DEVELOPMENT html
Introduction to HTML.
HTML Basics.
Html.
HTML basics
CGS 3066: Lecture 2 Web Development and HTML5
Web Development Part 1.
BHS Web Design Mr. Campbell
LAB Work 01 MBA 61062: E-Commerce
4.01 Cascading Style Sheets
HTML: HyperText Markup Language
Mansoor Ahmed Bughio.
HTML Lab 5 10/1/2015.
HTML.
Introduction to Web programming
Chapter 1: Introduction to XHTML (part 1)
HTML Robert McIntosh
Tag Basics.
CASCADING STYLE SHEET CSS.
Website Design 3
HTML Intro.
Software Engineering for Internet Applications
DynamicHTML Cascading Style Sheet Internet Technology.
Cascade Style Sheet Demo W3Schools. com: w3schools
CGS 3066: Lecture 2 Web Development and HTML5
DynamicHTML Cascading Style Sheet Internet Technology.
Training & Development
HTML Basic Structure.
Introduction to HTML Lecture 1 Kanida Sinmai
Web Application Development
Pertemuan 1 Desain web Pertemuan 1
Johan Ng and Muhammad Hazzry
Images in HTML PowerPoint How images are used in HTML
4.01 Cascading Style Sheets
Creating your website and learning HTML
Web Programming and Design
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

Internet & Web Engineering Course Code:CS-228 Credit Hours (3+1) Lab 1 Introduction to Markup Language HTML Instructor: Muhammad Zeeshan Haider Ali Blog Address: https://zeeshanaliatisp.files.wordpress.com

Hyper Text Markup Language

HTML HTML is a markup language for describing web documents (web pages). HTML stands for Hyper Text Markup Language A markup language is a set of markup tags HTML documents are described by HTML tags Each HTML tag describes different document content

HTML Syntax <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html>

DOCTYPE The DOCTYPE declaration defines the document type to be HTML

Syntax Explaination The text between <html> and </html> describes an HTML document The text between <head> and </head> provides information about the document The text between <title> and </title> provides a title for the document

Continued… The text between <body> and </body> describes the visible page content The text between <h1> and </h1> describes a heading. The text between <p> and </p> describes a paragraph

Tags <tagname>content</tagname> HTML tags normally come in pairs like <p> and </p> The first tag in a pair is the start tag, the second tag is the end tag The end tag is written like the start tag, but with a / slash before the tag name

Output

Write HTML Using Notepad or TextEdit Step 1: Open Notepad Step 2: Write Some HTML Step 3: Save the HTML Page

HTML Headings HTML headings are defined with the <h1> to <h6> tags: <h1>This is heading 1</h1> <h2>This is heading 2</h2> <h3>This is heading 3</h3> <h4>This is heading 4</h4> <h5>This is heading 5</h5> <h6>This is heading 6</h6>

Output

HTML Paragraphs HTML paragraphs are defined with the <p> tag: Example: <p>This is a paragraph.</p> <p>This is another paragraph.</p> Output: This is a paragraph.

HTML Links HTML links are defined with the <a> tag: Example <a href="http://www.w3schools.com">This is a link</a> Output This is a link

HTML Images HTML images are defined with the <img> tag. The source file (src), alternative text (alt), and size (width and height) are provided as attributes: Example <img src="w3schools.jpg" alt="W3Schools.com" width="104" height="142"> Output:

The lang Attribute he document language can be declared in the <html> tag. The language is declared in the lang attribute. <html lang="en-US">

The title Attribute HTML paragraphs are defined with the <p> tag. In this example, the <p> element has a title attribute. The value of the attribute is "About W3Schools": Example: <p title="About W3Schools"> Output: About W3Schools

HTML Horizontal Rules The <hr> tag creates a horizontal line in an HTML page. The hr element can be used to separate content: Example: <p>This is a paragraph.</p> <hr> <p>This is a paragraph.</p> <hr> <p>This is a paragraph.</p>

Output

The HTML <meta> Element he HTML <meta> element is also meta data. It can be used to define the character set, and other information about the HTML document. In the chapter about HTML styles you discover more meta elements: The HTML <style> element is used to define internal CSS style sheets. The HTML <link> element is used to define external CSS style sheets.

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: Example: <p>This is<br>a para<br>graph with line breaks</p> Output: This is a para graph with line breaks

The HTML <pre> Element The HTML <pre> element defines preformatted text. Example <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>

Output

HTML Styling Every HTML element has a default style (background color is white and text color is black). Changing the default style of an HTML element, can be done with the style attribute.

Example <body style="background-color:lightgrey"> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body>

OUPUT

Text Text Color <h1 style="color:blue">This is a heading</h1> Fonts <h1 style="font-family:verdana">This is a heading</h1> Text Size <h1 style="font-size:300%">This is a heading</h1> Text Alignment <h1 style="text-align:center">Centered Heading</h1>

Text Formatting Elements Bold <b> Strong <strong> Italic and Emphasized <i> <em> Small <small> Marked <mark> Deleted <del> Inserted <ins> Subscript <sub> Superscript <sup>

Text Formatting some example OUTPUT This text is bold This text is italic This is superscript

Quotations The HTML <q> element defines a short quotation. Browsers usually insert quotation marks around the <q> element. Example: <p>WWF's goal is to: <q>Build a future where people live in harmony with nature.</q></p> Output: WWF's goal is to: Build a future where people live in harmony with nature.

Continued… The HTML <blockquote> element defines a quoted section.

Some Other Element The HTML <abbr> element defines an abbreviation or an acronym. Example: <p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p> Output: The WHO was founded in 1948.

HTML <bdo> for Bi-Directional Override The HTML <bdo> element defines bi-directional override. Example: <bdo dir="rtl">This line will be written from right to left</bdo> Output:

HTML Computer Code Elements Keyboard Formatting: The HTML <kbd> element defines keyboard input. Example: <p>To open a file, select:</p> <p><kbd>File | Open...</kbd></p> Output:

Continued… Sample Formatting The HTML <samp> element defines a computer Example: <samp> demo.example.com login: Apr 12 09:10:17 Linux 2.6.10- grsec+gg3+e+fhs6b+nfs+gr0501+++p3+c4a+gr2b-reslog- v6.189 </samp> Output:

Continued… Code Formatting The HTML <code> element defines programming code. Example: <code> var person = { firstName:"John", lastName:"Doe", age:50, eyeColor:"blue" } </code>

Output The <code> element does not preserve extra whitespace and line-breaks.

Continued… Variable Formatting The HTML <var> element defines a mathematical variable. Example: <p>Einstein wrote:</p> <p><var>E = m c<sup>2</sup></var></p> Output:

Comment Tags Example: <!-- This is a comment --> <p>This is a paragraph.</p> <!-- Remember to add more information here --> Output:

Styling HTML with CSS CSS stands for Cascading Style Sheets Styling can be added to HTML elements in 3 ways: Inline - using a style attribute in HTML elements Internal - using a <style> element in the HTML <head> section External - using one or more external CSS files

Example: Output: Styling HTML with CSS <!DOCTYPE html> <html> <head> <style> body {background-color:lightgray} h1   {color:blue} p    {color:green} </style> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body> </html> Output:

Inline Styling (Inline CSS) Inline styling is useful for applying a unique style to a single HTML element Example <h1 style="color:blue">This is a Blue Heading</h1> Output:

Internal Styling (Internal CSS) An internal style sheet can be used to define a common style for all HTML elements on a page Example: <style> body {background-color:lightgrey} h1   {color:blue} p    {color:green} </style> output:

External Styling (External CSS) External style sheet are ideal when the style is applied to many pages. With external style sheets, you can change the look of an entire web site by changing one file. Example: <head>   <link rel="stylesheet" href="styles.css"> </head> Output:

Output: Example: CSS Fonts <!DOCTYPE html> <html> <head> <style> h1 {     color:blue;     font-family:verdana;     font-size:300%; } p  {     color:red;     font-family:courier;     font-size:160%; } </style> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body> </html> Output:

CSS Box Model CSS border property defines a visible border around an HTML element: Example: p { border:1px solid black; } Ouput:

CSS padding The CSS padding property defines a padding (space) inside the border: Example: p {     border:1px solid black;     padding:10px; } Ouput:

CSS margin The CSS margin property defines a margin (space) outside the border: Example p {     border:1px solid black;     padding:10px;     margin:30px; } Output:

Output: id Attribute: Attributes All the examples above use CSS to style HTML elements in a general way. To define a special style for one special element, first add an id attribute to the element: Example: <p id="p01">I am different</p> then define a different style for the (identified) element. p#p01 {     color:blue; } Output:

Output : class Attribute To define a style for a special type (class) of elements, add a class attribute to the element: Example: <p class="error">I am different</p> Now you can define a different style for all elements with the specified class: p.error {     color:red; } Output :