HTML is a markup language used to define the structure and layout of web pages. It was created by Tim Berners-Lee in 1990. Every webpage on the internet is written using HTML which contains elements like headings, paragraphs, links etc defined by tags that are used to structure and style the content.
HTML is a markup language used to define the structure and layout of web pages. It was created by Tim Berners-Lee in 1990. Every webpage on the internet is written using HTML which contains elements like headings, paragraphs, links etc defined by tags that are used to structure and style the content.
What is HTML? First developed by Tim Berners-Lee in 1990, HTML is short for Hypertext Markup Language. HTML is used to create 1 electronic documents (called pages) that are displayed on the World Wide Web.
Every web page you see on the Internet is
written using one version of HTML code or another.
ETL LABS PVT LTD – PHP 127
………….Hyper Text: Hyper Text simply means "Text within Text." A text has a link within it, is a hypertext. Whenever you click on a link which brings you to a new webpage, you have clicked on a hypertext. Hyper Text is a way to link two or more web pages (HTML documents) with each other. 2
Markup language: A markup language is a
computer language that is used to apply layout and formatting conventions to a text document. Markup language makes text more interactive and dynamic. It can turn text into images, tables, links, etc.
ETL LABS PVT LTD – PHP 128
………………Web Page: A web page is a document which is commonly written in HTML and translated by a web browser. A web page can be identified by entering an URL. A Web page can 3 be of the static or dynamic type. With the help of HTML only, we can create static web pages.
Hence, HTML is a markup language
which is used for creating attractive web pages with the help of styling, and which looks in a nice format on a web browser. An HTML document is made of many HTML tags and each HTML tag contains different content. ETL LABS PVT LTD – PHP 129 Description of HTML Example <!DOCTYPE>: It defines the document type or it instruct the browser about the version of HTML.
<html > :This tag informs the browser that it is
an HTML document. Text between html tag describes the web document. It is a container for 4 all other elements of HTML except <!DOCTYPE>
<head>: It should be the first element inside the
<html> element, which contains the metadata(information about the document). It must be closed before the body tag opens.
ETL LABS PVT LTD – PHP 130
<title>: As its name suggested, it is used to add title of that HTML page which appears at the top of the browser window. It must be placed inside the head tag and should close immediately. 5 (Optional)
<body> : Text between body tag
describes the body content of the page that is visible to the end user. This tag contains the main content of the HTML document.
ETL LABS PVT LTD – PHP 131
Features of HTML 1. It is a very easy and simple language. It can be easily understood and modified. 2. It is very easy to make an effective presentation with HTML because it has a lot of formatting tags. 3. It is a markup language, so it provides a flexible way to design web pages along with the text. 4. It facilitates programmers to add a link on the web pages (by html anchor tag), so it enhances the interest of browsing of the user. 5. It is platform-independent because it can be displayed on any platform like Windows, Linux, and Macintosh, etc. 6. It facilitates the programmer to add Graphics, Videos, and Sound to the web pages which makes it more attractive and interactive. 7. HTML is a case-insensitive language, which means we can use tags either in lower-case or upper-case.
ETL LABS PVT LTD – PHP 132
Anatomy of an HTML element The main parts of our element are as follows:
The opening tag: This consists of the name of
the element (in this case, p), wrapped in opening and closing angle brackets. This states where the element begins or starts to take effect — in this case where the paragraph begins. The closing tag: This is the same as the opening 7 tag, except that it includes a forward slash before the element name. This states where the element ends — in this case where the paragraph ends. Failing to add a closing tag is one of the standard beginner errors and can lead to strange results. The content: This is the content of the element, which in this case is just text. The element: The opening tag, the closing tag, and the content together comprise the element.
ETL LABS PVT LTD – PHP 133
Attribute of an element
Attributes contain extra information about the
element that you don't want to appear in the actual content. Here, class is the attribute name, and editor-note is the attribute value. The class attribute allows you to give the element an identifier that can be used later to target the element with 8 style information and other things. An attribute should always have the following:
• A space between it and the element name (or
the previous attribute, if the element already has one or more attributes). • The attribute name, followed by an equals sign. • The attribute value, wrapped by opening and closing quotation marks.
ETL LABS PVT LTD – PHP 134
Building blocks of HTML An HTML document consist of its basic building blocks which are: Tags: An HTML tag surrounds the content and apply meaning to it. It is written between < and > brackets. Attribute: An attribute in HTML provides extra information about the element, and it is applied within the start tag. An HTML attribute contains 9 two fields: name & value. Syntax <tag name attribute_name= " attr_value"> content </ tag name>
Elements: An HTML element is an individual
component of an HTML file. In an HTML file, everything written within tags are termed as HTML elements.