1. Trang chủ
  2. » Luận Văn - Báo Cáo

Lecture E-Commerce - Chapter 18: Hypertext markup language (HTML) (part I)

55 43 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

In this chapter, the following content will be discussed: Introduction to HTML, HTML elements, HTML editors, HTML basics, HTML attributes, HTML headings, HTML paragraphs, HTML text formatting, HTML comments, HTML hyperlinks (links).

CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad Virtual Campus, CIIT COMSATS Institute of Information Technology T2-Lecture-1 HyperText Markup Language (HTML) Part - I For Lecture Material/Slides Thanks to: www.w3schools.com Synopsis  Introduction to HTML  HTML Elements  HTML Editors  HTML Basics  HTML Attributes  HTML Headings  HTML Paragraphs  HTML Text Formatting  HTML Comments  HTML Hyperlinks (Links) T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com What is HTML?  HTML stands for Hyper Text Markup Language  HTML is a markup language  A markup language is a set of markup tags  The tags describe document content  HTML documents contain HTML tags and plain text  HTML documents are also called web pages T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Tags  HTML markup tags are usually called HTML tags  HTML tags are keywords (tag names) surrounded by angle brackets like  HTML tags normally come in pairs like

and

 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, with a slash before the tag name  Start and end tags are also called opening tags and closing tags content T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Elements HTML Elements  In HTML, most elements are written with a start tag (e.g

) and an end tag (e.g

), with the content in between:

This is a paragraph.

T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Elements  HTML documents are defined by HTML elements  An HTML element starts with a start tag / opening tag  An HTML element ends with an end tag / closing tag  The element content is everything between the start and the end tag  Some HTML elements have empty content  Empty elements are started with start tag  Most HTML elements can have attributes T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Document Example T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Example Explained  The

element: ◦

This is my first paragraph.

 The

element defines a paragraph in the HTML document The element has a start tag

and an end tag

The element content is: This is my first paragraph 10 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com Useful Tips Note: If an HTML file contains ten images - eleven files are required to display the page Loading images takes time So !!!Use images carefully When a web page is loaded, the browser, gets the image from a web server and inserts it into the page Therefore, make sure that the images are available in the same location in relation to the web page, otherwise the visitors will get a broken link icon The broken link icon shows that “image not found” 41 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Image Tags 42 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Lines  The tag creates a horizontal line in an HTML page  The hr element can be used to separate content: Example ◦

This is a paragraph.

This is a paragraph.

This is a paragraph.

43 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Line Breaks  Use the tag creates a new line without starting a new paragraph: Example ◦

This is a para graph with line breaks

Note: The element is an empty HTML element It has no end tag 44 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Output  We cannot be sure how HTML will display our web page; Large or small screens, and resized windows will create different results  With HTML, we cannot change the output by adding extra spaces or extra lines in your HTML code  The browser will remove extra spaces and extra lines when the page is displayed Any number of lines count as one line, and any number of spaces count as one space Solution ? Use Formatting tags 45 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Formatting Tags HTML Text Formatting Tags  HTML uses tags like and for formatting output, like bold or italic text are called HTML formatting tags  or defines bold or italic text only  or means that you want the text to be rendered in a way that the user understands as "important" Today, all major browsers render strong as bold and em as italics However, the browsers of future might change their options to represent strong and emphasizes text Example demo!!! ◦This text is bold This text is italic This is computer output This is subscript and superscript 47 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Text Formatting Tags… 48 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Comments HTML Comment Tags  Comment tags are used to insert comments in HTML  You can add comments to your HTML source by using the following syntax: ◦  Note: There is an exclamation point (!) in the opening tag, but not in the closing tag  Comments are not displayed by the browser, but they can help document your HTML  With comments you can place notifications and reminders in your HTML: Example ◦

This is a paragraph.

50 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Comment Tags…   Comments are also useful for debugging HTML, because you can comment out HTML lines of code, one at a time, to search for errors: Example ◦ >   Conditional Comments You might stumble upon conditional comments in HTML: ◦ some HTML here  51 Conditional comments defines HTML tags to be executed by IE only T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Links HTML Hyperlinks (Links)        Links are found in nearly all Web pages Links allow users to click their way from page to page The HTML tag defines a hyperlink A hyperlink (or link) is a word, group of words, or image that you can click on to jump to another document When we move the cursor over a link in a Web page, the arrow will turn into a little hand The most important attribute of the element is the href attribute, which indicates the link's destination By default, links will appear in all browsers as: ◦ An unvisited link is underlined and blue ◦ A visited link is underlined and purple ◦ An active link is underlined and red  The HTML code for a link is simple: ◦ Link text  The href attribute specifies the destination of a link 53 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Links - The target Attribute  The target attribute specifies where to open the linked document  The example below will open the linked document in a new browser window or a new tab:  Example ◦Visit W3Schools! 54 T2-Lecture-1 Ahmed Mumtaz Mustehsan www.w3schools.com The End HPML Part-I Thank You ... (Links) T2 -Lecture- 1 Ahmed Mumtaz Mustehsan www.w3schools.com What is HTML?  HTML stands for Hyper Text Markup Language  HTML is a markup language  A markup language is a set of markup tags.. .HyperText Markup Language (HTML) Part - I For Lecture Material/Slides Thanks to: www.w3schools.com Synopsis  Introduction... start tag  Most HTML elements can have attributes T2 -Lecture- 1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Document Example T2 -Lecture- 1 Ahmed Mumtaz Mustehsan www.w3schools.com HTML Example

Ngày đăng: 18/01/2020, 16:42

Xem thêm:

Mục lục

    HyperText Markup Language (HTML)

    HTML Tip: Use Lowercase Tags

    The <!DOCTYPE> Declaration

    Write HTML Using Notepad or TextEdit

    Steps to Create Your First Web Page

    Steps to Create Your First Web Page…

    HTML Tip - How to View HTML Source

    Always Quote Attribute Values

    The <img> Tag and the Src Attribute

    Set Height and Width of an Image

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w