WebsiteGear Logo Log In
New User? Sign Up
About | Contact | FAQ
  Home Content Site Development Website Technology Saturday, June 23, 2018 
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 Registration Now Open for NanoScientific Symposiums on SPM
Advanced Nano Fab Center Korea (Aug. 22-23) Suny Poly Tech Albany NY (Sept 19-20) Technical University Freiberg Germany (Oct. 10-12)
News Post Rural District Achieves Unprecedented Academic Growth with Personalized Learning and iPads
MIFFLINTOWN, Pa., June 21, 2018 /PRNewswire/ -- This year, students at Juniata County School District grew an impressive aver...
News Post Global Pulp and Paper Chemicals Markets Report 2018: Annual Estimates and Forecasts 2015-2022
DUBLIN, June 21, 2018 /PRNewswire/ -- The "Pulp and Paper Chemicals - Global Strategic Business Report" report has...
News Post Global Insulation Strategic Market 2016-2024: Insulation Marketplace Witness Surge in M&A Activity
DUBLIN, June 21, 2018 /PRNewswire/ -- The "Insulation - Global Strategic Business Report" report has been added to...
News Post Think Next: Microsoft for Startups China Enables Chinese Innovations to "Go Global" and Overseas Innovations to "Go China"
SHANGHAI, June 21, 2018 /PRNewswire/ -- Microsoft ScaleUp Shanghai today hosted the Think Next demo day for its third cohort...
Submit News | View More NewsView more news
RELATED CLASSIFIED ADS
Classified Ad HTML TAGGING PROJECT CONVERSION AVAILABLE
We have developed HTML Tagging Conversion software which can convert any TIFF Frech Srcipt Image to ...
Classified Ad SQL BI ONLINE TRAINING WITH PROJECT
SQL School, one of the best institutes for online training provides Microsoft Business Intelligence ...
Classified Ad SSIS, SSAS, SSRS ONLINE TRAINING WITH PROJECT
SQL School, one of the best institutes for online training provides Microsoft Business Intelligence ...
Classified Ad Get OpenCart E-commerce Website with 20 % Discount
Inception System is the Leading E-commerce solutions Provider Company which has vast experience in O ...
Classified Ad Web-Software Development | Mobile App | Ecommerce
Rightway Solution started off with servicing clients in Responsive Web Development and E-commerce De ...
Post Free Ad | View More View more classifieds
RELATED FORUM POSTS
Forum Post How to convert psd into html?
Please let me know how to convert psd into html? I want to create a design from photoshop! ...
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 HTML to enhance my javascript menu
To anyone that can help me I would really appreciate it! I have a javascript menu on a couple of ...
Forum Post HTML TAGGING PROJECT CONVERSION 100% QUALITY
We can process Image/TIF/GIF files to html format. We have developed HTML Tagging Conversion Softwa ...
Forum Post DIY photo collage yearbook with digital photos
Christmas is coming and a year also comes to its end right away. From beginning to end, from spring ...
Add New Post | View More View more forum posts
POPULAR ARTICLES
Nav How To Sell A Website
Nav Subdomain Configuration - How To Setup A Sub Domain
Nav Domain Configuration - How To Setup A Domain Name
Nav Website Layout - Tips & Tricks
Nav Round Robin DNS Load Balancing
Nav Introduction To Server Load Balancing
Nav Website Traffic & Revenue
Nav Tips On Using SubDomain
FEATURED NEWS | POPULAR NEWS