Page 34 - 2403_Trackpad_V5.1_C6_Fb
P. 34
Syntax to specify the attribute of any tag:
<tag_name attribute_name = “value”>
Tick ( ) if you know this.
HTML is the primary building block for creating a webpage.
Tags that have both opening and closing tags are known as container tags. HTML COMMENTS
Comments are used to add notes or explanations within an HTML document. They help the
NESTING OF TAGS programmer by making it easier to understand and edit the document later. You can add
comments using a special tag, which looks like this: <!-- comment goes here -->.
Nesting of tags means that you can place a new tag inside another tag before closing the first one.
These tags follow the LIFO principle, which stands for Last In, First Out. This means the tag that is For example, <!-- This is a comment in HTML -->
opened last must be closed first.
RULES FOR WRITING HTML CODES
There are some rules for writing HTML codes:
BASIC HTML TAGS Container tags should always be closed properly.
Let’s learn the basic tags of HTML. Values given to the attributes should be enclosed within the double-quotes.
Tag name should not contain spaces.
There should be no space between < and > in a tag.
Tags Description
Tags must be nested correctly.
The <HTML> tag tells the web browser that the text contained between
<HTML> <HTML> and </HTML> is a web page and can be viewed using a web STRUCTURE OF AN HTML DOCUMENT
browser.
The structure of an HTML document is:
The <HEAD> tag represents the header area of the document. It
<HEAD> contains information about the document title, scripts and style <!DOCTYPE HTML>
definitions used in the document. <HTML>
<HEAD>
The <TITLE> tag represents the title of the document and is used inside <TITLE> The title of the webpage goes here. </TITLE>
<TITLE> the <HEAD> tag. The title appears on the title bar of the browser window.
</HEAD>
If you do not want to give title to your web page, you can skip it.
<BODY>
The <BODY> tag defines the part of the HTML document that is visible
in the web browser. It contains all other tags that define the content All the visible content of the webpage is documented here,
<BODY> containing bulk of information. The section contains various
presentation elements such as images, lists, tables, text and links to
HTML tags defining the structure and layout of the page content.
move between the webpages.
</BODY>
</HTML>
The DOCTYPE declaration at the beginning of page specifies that the document is written in
ATTRIBUTES
HTML5. In HTML5, the DOCTYPE declaration is required.
An attribute is used to define some extra features or properties of an HTML tag. All attributes
have two parts: name and value. The ‘name’ is the property that you want to set. The ‘value’ is
what you want for the respective property.
32 Premium Edition-VI

