Page 80 - ConceptGP_C6_Fb
P. 80
Syntax to specify the attribute of any tag:
<tag_name attribute_name = “value”>
Tick ( ) if you know this.
For example, the <HR> tag has a COLOR attribute, which allows changing the colour of the line.
HTML or Hypertext Markup Language is the primary building block for creating a webpage.
<HR COLOR = “RED”>
Tags that have both opening and closing tags are known as container tags.
HTML COMMENTS
NESTING OF TAGS
Nesting of tags means that you can start a new tag before closing the previous tag. These tags Comments are used to write notes about the concerned HTML document. This helps the
are nested on the LIFO principle, which is Last In First Out. It means the tag that has been opened programmer in editing the document later. Any program description can be added in the form of
last needs to be closed first. comments. We can add comments in our program using a comment tag <!-- -->.
BASIC HTML TAGS RULES FOR WRITING HTML CODES
Let’s learn the basic tags of HTML. There are some rules for writing HTML codes:
Container tags should always be closed properly.
Values given to the attributes should be enclosed within the double-quotes.
Tags Description
Tag name should not contain spaces.
There should be no space between < and > in a tag.
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 Tags must be nested correctly.
browser.
The <HEAD> tag represents the header area of the document. It STRUCTURE OF AN HTML DOCUMENT
<HEAD> contains information about the document title, scripts and style The structure of an HTML document is:
definitions used in the document.
<!DOCTYPE HTML>
The <TITLE> tag represents the title of the document and is used inside
<TITLE> the <HEAD> tag. The title appears on the title bar of the browser window. <HTML>
<HEAD>
If you do not want to give title to your web page, you can skip it.
<TITLE> The title of the webpage goes here. </TITLE>
The <BODY> tag defines that section of the HTML document which is </HEAD>
visible on the web browser. It contains all other tags that define the
<BODY>
content presentation elements such as images, lists, tables, text and <BODY>
links to move between the webpages. All the visible content of the webpage is documented here,
containing bulk of information. The section contains various
HTML tags defining the structure and layout of the page content.
</BODY>
ATTRIBUTES </HTML>
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 The DOCTYPE declaration at the beginning of page specifies that the document is written in
what you want for the respective name. HTML5. In HTML5, the DOCTYPE declaration is required.
78 Premium Edition-VI

