Home / html Tutorials / What is HTML Attributes

HTML Attributes:

HTML attributes have elements, those are provide additional value information the elements, attributes comes In name or value like- name=”value”, attributes are always concomitant in the starting tag elements.

Before post we had seen few of HTML tags and their usage as well, like heading tags <h1>, <h2>, paragraph tag <p> and other tags, most of the html tags contain attributes, which are exist extra bit information. All attributes are placed inside two parts a ‘name’ and a ‘value’. Generally HTML attributes separated by “=” and written as tag attributes=”value”, the syntax of the html attributes is name=”value”


The Style Attributes:

HTML paragraph are determine with the <p> tag. In this example, the <p> element has a style attribute. Inside any <style> elements specify how to render in s browser using html elements, each html documents have multiple <style> tags. Here the value of attributes is : “font-family:arial; color:#FF0000;”, the style attributes admit you to specific casecading style sheet within the elements.

Example:

<!DOCTYPE html>

<html>

<head>

<title>The style Attribute to My Story </title>

</head>

<body>

<p style=”font-family:arial; color:#FF0000;”>Interest your text goes here…</p>

</body>

</html>

Here just explaining how to use style attributes, but not talking about depth css learning, so lets go-ahead without any hassle much about css. Here in that case just need to learn and understand about what are HTML attributes and how we can perform while using.

Internationalization Attributes

There are three internationalization attributes , they are :

   1. dir

   2. lang

  3.  xml:lang

The Lang Attributes:

Language document can denotes in the <html> tag, language is reveal in the lang attributes. Language declaring is important approach. Language attributes allows you to styling of your content by language, identifying the language of your content allows automatically this lang attributes and also can change behaviours of the page as well as page of look. Some of the language attributes can work whole level of the document. This attributes was retain in HTML only for backwards compatibility with earlier versions of html. Later on this attributes only has replaced by the XML:lang attributes in new XHTML.

Example:

<!DOCTYPE html>

<html lang=”en-US”>

<body>

</head>

<body>

English Language Paragraph

</body>

</html>

Dir Attributes:

The dir attributes indicates the text direction of the elements of the content. It allows two value of direction, those are would be left to right and right to left.

Our default value is “ltr” that is left to right and second dir attributes can use Arabic or Hebrew, they are read from right to left.

Attributes Values:

Value Description
ltr Default. Left-to-right text direction
rtl Right-to-left text direction

Example:

<!DOCTYPE html>

<html dir=”rtl”>

<head>

<title>Display Your Text Directions From</title>

</head>

<body>

Keep Your Text

</body>

</html>

The Title Attribute: Title attributes has become more popular using any website especially in wordpress widly used. Which is default duplicates the every post in the title attributes. Title supposed to provide additional information about the require page well. The behaviour of the title attributes will depend on the element express, it is displayed as tooltip when we move our cursor on the element.

<!DOCTYPE html>

<html>

<head>

<title> Our The title Attribute Example </title>

</head>

<body>

<h3 title=”Hi Dear Attributes!”>title Heading Tag goes here</h3>

</body>

</html>

The href Attributes:

The anchor text is supposed to “name” the link whenever the title text provides information about where the link will send the user. Html Links are defined with the <a> tag, the syntax of this href attributes has follows below example.

<a href=https://www.alldesigncreative.com> This is my site link </a>

The Class Attribute:

Class attributes which is most important of many HTML and XHTML elements, and commonly to identify them for styles. Class attributes is particularly useful when you add with style sheets, for example consider the following example.

class=”Name1 Name2 Name3″

you can learn more about class attributes while you learning cascading style sheet (CSS)

Note: some older browser doesn’t support multiple classes, such type of browsers typically ignores a class attributes.





With Your Donation Help Us to Producing more Free Resources!

About Author Sudharsan

Chief Editor of Alldesigncreative.com, a designer, developer and animator. He spends most of the time to creating designs and animations includes visual effects. He loves so much to create all type of designing and has excellent knowledge in all kind of design roots.