Friday, 3 February 2017

INTRODUCTION TO HTML ATTRIBUTES

Attributes are special features of a tag. Every tag contains none or one or many attributes.

Parameters – Parameters are the values that we assign to an attributes. Syntax -  <tag attribute=”parameter”>, Example - <body bgcolor=”red”>

Types of Attributes – In HTML5 attributes are classified into different types.
·        Element Specific Attributes – These attributes are exclusively for a specific element of tag. Example - <body> - [ bgcolor, background, text], <img> - [src, width, height, alt]
·        Global Attributes – It has following a following alias name – Standard Attributes, Dynamic Attributes, Common Attributes etc. Example – class, id, lang, insert, spellcheck, style
·        Event Attributes – These attributes are related to JavaScript. Example – onclick, oninput, onprogress, onchange, onload, oninvalid
·        Optional Attributes – Some attributes HTML5 is treating as optional or not required. Example – In HTML4 <link rel=”stylesheet” type=”text/css” href=”abc.css”>, In HTML5 <link rel=”stylesheet” href=”abc.css”>


HTML5 special characters – These are popularly known as character entities. All entities begin with an & and ends with ;. Example - &copy; , &reg; , &trade; , &larr; etc.

No comments:

Post a Comment