HTML Attributes




Attributes are used to personalize tags What do I mean? Somehow, someday you want to resize an image or a table or change a font color. All these features are possible with the help of

Most of the tags have their properties, we will talk about it because we add it to our new tags. We will learn about a set of common properties, which can be used with most of the tag

Attribute is placed between the angular brackets (<>) of the opening tag



"class" and "id" attributes in HTML

These two characteristics are mostly the same, they have no direct role in the formatting of the elements, but they are useful behind the scenes with the help of CSS. When we study their syntax and their work in CSS, we will talk about their role at the right time.

The idea is that when you want to define a range of tags to be used later with the help of CSS, you can make a difference between two identical tags but with different attributes. Take a look at the next example:

Example-

<p id="italic">Paragraph type 1, italic </p>
<p id="bold">Paragraph type 2, bold </p>

The "name" attribute

"name" is a bit different from "id" and "class". If you give a name to an element, this is a script variable for JavaScript, ASP and PHP. Something that is very often meet in formulations and other interactive text fields ...

Example-

<input type="text" name="TextField" />

"title" attribute

This feature is rarely used. It adds a title (a pop-up) to the content of each element. This feature should not be forgotten. You can name almost everything, though you want visualization to appear when you need to pause your mouse over the content for a few seconds.

Example-

<h2 title="I am a title!!">A title</h2>

"align" attribute

If you want to align some elements of your page in a different way, then you have about the "align" attribute. You can align almost every element in the center of the left, right or center. The basic elements will be aligned to the left, except that it should be specified as another alignment.

Example-

<h2 align="center">Centered title </h2>

AttributeOptionsFunction
alignright, left, centerHorizontal alignment
valigntop, middle, bottomVertical alignment
bgcolornumerical, hexadecimal, or RGB valueA background behind an element.
backgroundURLAn image behind an element.
idDefined by userNames an element which will be used with CSS.
classDefined by userClassifies un element which will be used with CSS
widthNumerical valueSpecifies the width of a table, image or table box.
heightNumerical valueSpecifies the height of an table,
titleDefined by user"pop-up" a title for an element
Share on Google Plus

About It E Research

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment