HTML Attributes
Attributes provide additional information about the tag and they are placed within the opening tag and they follow a precise syntax. With the help of attributes we add the body colors, align text etc.
HTML - ID Attribute
The "id" attribute plays a major role in formatting your text but it serves behind the scene.
It calls the id values from the Cascading Style Sheets (CSS) file and format your text accordingly.
We will discuss about CSS in detail in our CSS tutorials.
Example:
<p id="bold"> Paragraph text in Bold </p>
<p id="small"> Paragraph text in small size </p>
HTML - Name Attribute
The name attribute is used to add a scripting varible to an element.
This variable can be used with the scripting languages such as Javascript, PHP etc. The name attribute is widely used with user-input elements.
Example:
<input type="text" name="TextName" />
HTML - Title Attribute
The title attribute is used to give a title text to your headings, images etc.
This attribute do not have any direct impact but when you keep the mouse over the image of text you can see the title poping up.
Example:
<h2 title="Heading!!!">Heading Tag 2</h2>
The title attribute provides some useful information to the users.
HTML - Align Attribute
The align attribute is used to format the text. You may use left, right or center.
Example:
<h3 align="left">Left aligned</h3>
<h3 align="center">Centered</h3>
<h3 align="right">Right aligned</h3>
Some of the important attributes and its functions are given below.
align - Horizontally aligns tags
valign - Vertically aligns tags.
bgcolor - Places a background color behind an element.
background - Places an background image behind an element
id - Names an element for use with Cascading Style Sheets.
class - Classifies an element for use with Cascading Style Sheets.
width - Specifies the width of tables, images, or table cells.
height - Specifies the height of tables, images, or table cells.
title - "Pop-up" title for your elements.
Related posts:
Your IP address1 is: 172.18.0.2
Tutorials
Latest Updates
Follow us
- Tech-Tutorials twitter.com/techcuriosity