/    Sign up×
Community /Pin to ProfileBookmark

What is the difference between Html Tag and html attribute?

Hello,
Tell me the difference between Html Tag and html attribute.

to post a comment
HTML

8 Comments(s)

Copy linkTweet thisAlerts:
@ryanbutlerJul 24.2013 — Html tag is <html>, while html attribute is <html lang="en">
Copy linkTweet thisAlerts:
@rajendran123Jul 24.2013 — 

HTML tags
-----------



Tags are used to mark up the start and end of an HTML element.

ex : <p>

HTML attributes
----------------



An attribute defines a property for an element, consists of an attribute/value pair, and appears within the element’s start tag.

ex : <img src="banner.gif" alt="banner">

Here is the link that might be useful, E-commerce Website
Copy linkTweet thisAlerts:
@thomasbruceJul 25.2013 — We write Html tag like: <html>,

and html attribute write like : <html lang="en">
Copy linkTweet thisAlerts:
@aishasonyJul 25.2013 — A tag is a declaration of a HTML object whereas an Attribute is a property of an object.
Copy linkTweet thisAlerts:
@alendonaldauthorJul 26.2013 — Thanks to everyone for this information.
Copy linkTweet thisAlerts:
@CharlesJul 28.2013 — Actually, those answers are wrong. They have elements and tags mixed up. An HTML document is built up out of elements and attributes. The Elements are all nested with the HTML element being the outer level / root element. Now each element may also contain certain attributes. A P element might contain the text node "Hello, World!" and also a style attribute. Attributes are in key / value pairs so the style attribute would be set to some value.

Tags create elements and attributes. The tag [font=monospace]<html lang=en">[/font] creates an HTML element with a lang attribute with a value of "en". By convention we would call that whole thing the HTML tag and it creates the HTML element and its attributes.

To make matters worse, tags are not the only way to create elements. In HTML the HTML, HEAD and BODY elements are required but the tags are not. If you omit the tags then the element is there nonetheless.
Copy linkTweet thisAlerts:
@sezo111Jul 30.2013 — Hi,

The tags describe document content

Attributes provide additional information about an element
Copy linkTweet thisAlerts:
@grace2Jul 31.2013 — An attribute defines property for a HTML tag like

<img src="xyz.png" alt="banner">

Here we can see that <img> is a html tag and "alt" is attribute of the img tag with the value "banner".
×

Success!

Help @alendonald spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...