WebsiteGear Logo Log In
New User? Sign Up
About | Contact | FAQ
  Home Content Site Development Website Technology Thursday, July 24, 2008 
POPULAR ARTICLES
Nav Subdomain Configuration - How To Setup A Sub Domain
Nav Website Layout - Tips & Tricks
Nav Round Robin DNS Load Balancing
Nav Domain Configuration - How To Setup A Domain Name
Nav Introduction To Server Load Balancing
Nav Server Load Balancing Methods
Nav Tips On Using SubDomain
Nav Breadcrumb Navigation
FEATURED NEWS | POPULAR NEWS
View More News View More News
SPONSORED LINKS
Print| Email| Save| Discuss| Feeds


HTML Attributes
Published: Tuesday, November 04, 2003












Check

What are HTML Attributes?


HTML elements can have associated properties known as attributes. Attributes are
added to an element as name-value pairs before the closing '>' of the element's
start tag. An attribute consists of 2 parts - a name (e.g. face) and a value
(e.g. Arial).

Example: <img src="/images/logo.gif" alt="Logo" width="400" height="300">


In the above example, there are 4 attributes of the image element. The name of these
attributes are src, alt, width and height. The corresponding values are /images/logo.gif,
Logo, 400 and 300.




  • Any number of (legal) attributes can be added to an element.

  • Attributes are added in the name="value" format.

  • Attributes are separated by spaces.

  • Attribute names are not case sensitive.

  • It is a good coding practice to enclose attribute values within double quotes (").

  • If quotes are not used, values can consist of letter (a-z and A-Z), digits (0-9),
    hyphens and periods.




Check

Some commonly used HTML attributes


Here is a list of commonly used attributes.



  1. align :


    Alignment attribute - Aligns the element in horizontal direction.

    Values - left | center | right

    Some related elements - <img>, <input>, <table>, <hr>,
    <th>, <td>, <tr>, <iframe>.





  2. valign :


    Vertical Alignment attribute - Aligns the element in vertical direction.

    Values - top | middle | baseline | bottom

    Some related elements - <th>, <td>, <tr>, <tbody>.





  3. width :


    Width attribute - Specifies the width of an element.

    Values - pixels | % of parent width

    Some related elements - <table>, <hr>, <iframe>, <img>,
    <td>, <th>.





  4. height :


    Height attribute - Specifies the height of an element.

    Values - pixels | % of parent height

    Some related elements - <table>, <hr>, <iframe>, <img>,
    <td>, <th>.





  5. size :


    Width attribute - Specifies the width of an element.

    Values - pixels | % of parent cell

    Some related elements - <table>, <hr>, <iframe>, <img>,
    <td>, <th>.





  6. face :


    Face attribute - Sets the face of a font attribute. Font faces are specified as
    comma-separated list. The font element attributes may not be supported in future HTML versions (deprecated).
    W3C recommends using style sheets for formatting instead of HTML formatting attributes.


    Some values - Arial | Verdana | Helvetica

    Related elements - <font>, <basefont>.






Previous Article HTML Elements HTML Head Next Article
Print| Email| Save| Discuss| Feeds
RELATED ARTICLES
Nav HTML Tutorial - Introduction
HTML stands for Hyper Text Markup Language. It is the publishing language of the World Wide Web (WWW). Learn about HTML in this tutorial.
RELATED NEWS
News Post Allenergy's Story on More Than 100 Web Sites!
INDEPENDENCE, Kan. , July 24 /PRNewswire-FirstCall/ -- Allenergy, Inc. (Pink Sheets: ALRY), a profitable independent oil and...
News Post Building Blocks Continues to Demonstrate Effectiveness in Achieving Math Proficiency
Federally Funded Research Study Shows Students Using Math Software Outscore Peers
News Post MOP Environmental Solutions, Inc. Featured on Sustainable Shipping
BATH, N.H. , July 24 /PRNewswire-FirstCall/ -- MOP Environmental Solutions, Inc. (OTC Bulletin Board: MOPN.pk), a green manuf...
News Post The Best Construction Takeoff Software on the Market Just Got Better
PlanSwift's New 8.2 Software Release Provides Faster Estimating, More Third-Party Capabilities and Easier Methods for Takeoff and Estimation
News Post Global Growth Rate of Flights Continues to Slow
- Drop in US domestic operations is countered by growth within Europe and Asia
Submit News | View More NewsView more news
RELATED CLASSIFIED ADS
Classified Ad Web Design, Development, E-Commerce Sol.
At mindavenues, we specialize in website designing, strategic planning, and Content Development. Our ...
Classified Ad Web hosting reviews and discount coupons
http://www.hostingdiary.comWebHostingDiary is a popular blog providing web hosting news, reviews and ...
Classified Ad Internet Marketing India
Internet Marketing India Using the interactive technologies available via the Internet to furth ...
Classified Ad cPanel, Directadmin, or Plain linux VPS Plans
Virtual Private servers from $17.99 - Empire Technology For a limited time Empire Technology is o ...
Classified Ad Web design and development service from Sunsoft
We offer software development solutions, such as web design, web development, graphical design, flas ...
Post Free Ad | View More View more classifieds
RELATED FORUM POSTS
Forum Post html code help
I have been trying to use a code for media on my website however the Window media player comes up on ...
Forum Post How do you use PSD templates as web sites?
I have used HTML, free templates before but although i can edit PSD templates easily using photoshop ...
Forum Post Blank space under web poll
Hi again! Why is it so much blank space under the poll window? (See http://lemachin.bleublog.ch/pip ...
Forum Post Need some help in photoshop while creating a web.
i am creating a website on music, i have selected a template from a website but i don`t know the fur ...
Forum Post Freeware to document IT infrastructure for SQL
I just started using this good free software that lets you document your entire IT infrastructure. ...
Add New Post | View More View more forum posts


Copyright © 2003-2008 WebsiteGear Inc. All rights reserved.
About | Advertise | Submit Content | Privacy | Agreement | Contact