HTML-Attributes

HTML Attributes provide additional properties to HTML elements like width, font


HTML Attributes Syntax

Attributes are provided with start tag of HTML element.

Start tag Element content End tag
<h1 class="heading"> Heading1 element </h1>
<a href="index.html"> link element and attributes </a>
<label id="myid"> ID aattributes  
<table style="Width:400px"> Element with Styleattributes </table>

The start tag is often called the opening tag. The end tag is often called the closing tag. Closing tag generly has backslash


Generally you specify following type of attributes

Attribute Description
class Class attributes specifies one or more classnames for an element (refers to a class in a style sheet)
id ID attributes specifies a unique id for an element.  Using ID you can manipulate attribute using Javascript or other programming language.
style Style atttribute specifies  inline CSS style for an element
title Title attribute add extra information about an element (displayed as a tool tip)





Attributes    Blocks    Color-Values    Colornames    Colors    Comments    CSS    Editors-for-writing-html    Elements    Entities    Formatting-in-HTML    Forms    Head    Headings    HTML-Reference    IFrames    Image    Javascript    Layouts    Links    Options for building websites    Paragraphs    pointers and questions    Symbol-for-Mathmatics    Symbol-for-Punctuations    Symbols    Tables    Whats-new-in-HTML5   

Advertisement

Topics