create account

HTML 5 Tutorial #5 - HTML Attributes by cj23

View this thread on: hive.blogpeakd.comecency.com
· @cj23 ·
$36.77
HTML 5 Tutorial #5 - HTML Attributes
# HTML Attributes
HTML attributes can be added in all HTML elements. This is to provide **additional information** about the element. You can add an attribute to an element by specifying it in the **start tag**. It is usually come in name / value pairs like **name = "value"**.

## The href Attribute
href attribute can be seen or put in the anchor tag < a > < /a>. It specifies the link address where you want to move or redirect the users once they clicked the link. 

![example.png](https://steemitimages.com/DQmYT5yEDgx5jvazEvqfuHqc3zsmZgheSKdoatN4dcceeSt/example.png)

## The src Attribute
src attribute can be found or put in the < img >. It identifies the location and filename of the image source. 

![example.png](https://steemitimages.com/DQmaZK86pKdQC4zQxwpeXzjt2VboywWt2c3nf4nrQ9hdAWD/example.png)

## The width and height Attributes
width and height attributes give you the control to the size of the image or other HTML elements in pixels. 

![example.png](https://steemitimages.com/DQmYwHK5zskwCdovR4WVG4w9gkwtfq4faGzYndQ3zM9Vaeq/example.png)

## The alt Attribute 
alt attribute serves as an alternative information wherein if the image is not displayed, a text will be displayed. It's value can also read by screen readers, meaning the user can hear its value. 

![example.png](https://steemitimages.com/DQme2QjsZ6UJRF7gKQj5rEvL5TzQGmQcKoKsRgHSv3pe4yv/example.png)

## The style Attribute
style attribute allows you to specify the styling of an element like font, size, color, etc. 

![example.png](https://steemitimages.com/DQmYhMsF3R2xr79QBYS8GkF6NdbuyLSQsmLJY7aSXMkJV4S/example.png)

## The lang Attribute 
lang attribute is the language of the document and it can be declared in < html > tag. It's important to declare for accessibility applications (screen readers) and search engines. 

![example.png](https://steemitimages.com/DQmdvHxAEHi4fT6tv5yjA2k3bJkeFA2VgZQBDmppM9B82rH/example.png)

 (en) specify the language. If there is a dialect, use two more letters (US).

## The title Attribute
title attribute serves as a tool tip. The value of it will be displayed when you hover your mouse on the element. 

![example.png](https://steemitimages.com/DQmPk8B6w7QM72XVFZnaKn4xRHiELbczhk8vPjRk237RPGK/example.png)

## Use Lowercase Attributes
The HTML 5 standard is not case sensitive. You can use uppercase or lowercase attribute names like title or TITLE but I recommend lowercase for stricter document types like XHTML. 

## Quote Attribute Values
The HTML 5 standard does not require quotes around attribute values. It can be name = value or name = "value" but I recommend to quote attribute values to avoid unexpected results or/and errors like below. 

![example.png](https://steemitimages.com/DQmefxVs7Xw8nrGzD848N5zQuBhfyhxHy7mPu2BBo73Sjoz/example.png)

## Single or Double Quotes?
it is common to use the double quotes in HTML but single quote can also be used especially if the value needs to display a double quotation. 

< p title='John "ShotGun" Nelson' > or < p title="John 'ShotGun' Nelson" >

## HTML Attributes
Here are some list of attributes often used in HTML. 

![example.png](https://steemitimages.com/DQmXmMYJLQ6Qx9aSVxvwJzXi3BwnofKub2wEKXtu8rhR9xM/example.png)

<hr> 

*Note: There should be no space in the HTML tags or between the angle brackets and element name. I just put a space for it to display the tags as it will hide or not display without a space. Remember, web browser don't display HTML tags.*

<hr> 

### HTML 5 Tutorials:
[HTML 5 Tutorial #1 - Introduction](https://steemit.com/steemit/@cj23/html-tutorial-1-introduction)
[HTML 5 Tutorial #2 - HTML Editors](https://steemit.com/steemit/@cj23/html-tutorial-2-html-editors)
[HTML 5 Tutorial #3 - HTML Basic](https://steemit.com/steemit/@cj23/html-5-tutorial-3-html-basic)
[HTML 5 Tutorial #4 - HTML Elements](https://steemit.com/steemit/@cj23/html-5-tutorial-4-html-elements)
👍  , , , , , , , , , , , , , , , , ,
properties (23)
authorcj23
permlinkhtml-5-tutorial-5-html-attributes
categorysteemit
json_metadata{"tags":["steemit","steem","blog","philippines","steemph"],"image":["https://steemitimages.com/DQmYT5yEDgx5jvazEvqfuHqc3zsmZgheSKdoatN4dcceeSt/example.png","https://steemitimages.com/DQmaZK86pKdQC4zQxwpeXzjt2VboywWt2c3nf4nrQ9hdAWD/example.png","https://steemitimages.com/DQmYwHK5zskwCdovR4WVG4w9gkwtfq4faGzYndQ3zM9Vaeq/example.png","https://steemitimages.com/DQme2QjsZ6UJRF7gKQj5rEvL5TzQGmQcKoKsRgHSv3pe4yv/example.png","https://steemitimages.com/DQmYhMsF3R2xr79QBYS8GkF6NdbuyLSQsmLJY7aSXMkJV4S/example.png","https://steemitimages.com/DQmdvHxAEHi4fT6tv5yjA2k3bJkeFA2VgZQBDmppM9B82rH/example.png","https://steemitimages.com/DQmPk8B6w7QM72XVFZnaKn4xRHiELbczhk8vPjRk237RPGK/example.png","https://steemitimages.com/DQmefxVs7Xw8nrGzD848N5zQuBhfyhxHy7mPu2BBo73Sjoz/example.png","https://steemitimages.com/DQmXmMYJLQ6Qx9aSVxvwJzXi3BwnofKub2wEKXtu8rhR9xM/example.png"],"links":["https://steemit.com/steemit/@cj23/html-tutorial-1-introduction","https://steemit.com/steemit/@cj23/html-tutorial-2-html-editors","https://steemit.com/steemit/@cj23/html-5-tutorial-3-html-basic","https://steemit.com/steemit/@cj23/html-5-tutorial-4-html-elements"],"app":"steemit/0.1","format":"markdown"}
created2018-01-26 16:56:06
last_update2018-01-26 16:56:06
depth0
children6
last_payout2018-02-02 16:56:06
cashout_time1969-12-31 23:59:59
total_payout_value27.827 HBD
curator_payout_value8.941 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,882
author_reputation1,090,777,745,148
root_title"HTML 5 Tutorial #5 - HTML Attributes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id32,518,291
net_rshares4,117,454,866,610
author_curate_reward""
vote details (18)
@appreciator ·
<p>This post has received gratitude of 0.68 % from @appreciator thanks to: @cj23.</p>
properties (22)
authorappreciator
permlinkre-cj23-html-5-tutorial-5-html-attributes-20180127t041704131z
categorysteemit
json_metadata{"tags":["steemit"],"app":"drotto/0.0.3"}
created2018-01-27 04:17:03
last_update2018-01-27 04:17:03
depth1
children0
last_payout2018-02-03 04:17:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length86
author_reputation55,801,543,512,306
root_title"HTML 5 Tutorial #5 - HTML Attributes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id32,641,506
net_rshares0
@boomerang ·
This post has received a 1.51 % upvote from @boomerang thanks to: @cj23
properties (22)
authorboomerang
permlinkre-html-5-tutorial-5-html-attributes-20180127t050429
categorysteemit
json_metadata"{"app": "pysteem/0.5.6"}"
created2018-01-27 05:04:30
last_update2018-01-27 05:04:30
depth1
children0
last_payout2018-02-03 05:04:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length71
author_reputation1,273,205,827,891
root_title"HTML 5 Tutorial #5 - HTML Attributes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id32,649,257
net_rshares0
@booster ·
<p>This post has received a 0.65 % upvote from @booster thanks to: @cj23.</p>
properties (22)
authorbooster
permlinkre-cj23-html-5-tutorial-5-html-attributes-20180127t042747152z
categorysteemit
json_metadata{"tags":["steemit"],"app":"drotto/0.0.3rc3"}
created2018-01-27 04:27:48
last_update2018-01-27 04:27:48
depth1
children0
last_payout2018-02-03 04:27:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length78
author_reputation68,767,115,776,562
root_title"HTML 5 Tutorial #5 - HTML Attributes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id32,643,407
net_rshares0
@lovejuice ·
re-cj23-html-5-tutorial-5-html-attributes-20180127t051137400z
This post has received a 4.17% upvote from @lovejuice thanks to @cj23. They love you, so does Aggroed. Please be sure to vote for Witnesses at https://steemit.com/~witnesses.
properties (22)
authorlovejuice
permlinkre-cj23-html-5-tutorial-5-html-attributes-20180127t051137400z
categorysteemit
json_metadata{"app":"postpromoter/1.7.4"}
created2018-01-27 05:11:36
last_update2018-01-27 05:11:36
depth1
children0
last_payout2018-02-03 05:11:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length174
author_reputation10,538,740,461,622
root_title"HTML 5 Tutorial #5 - HTML Attributes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id32,650,423
net_rshares0
@postpromoter ·
re-cj23-html-5-tutorial-5-html-attributes-20180127t054115779z
You got a 0.74% upvote from @postpromoter courtesy of @cj23! Want to promote your posts too? Check out the [Steem Bot Tracker website](https://steembottracker.com) for more info. If you would like to support development of @postpromoter and the bot tracker please [vote for @yabapmatt for witness!](https://v2.steemconnect.com/sign/account-witness-vote?witness=yabapmatt&approve=1)
properties (22)
authorpostpromoter
permlinkre-cj23-html-5-tutorial-5-html-attributes-20180127t054115779z
categorysteemit
json_metadata{"app":"postpromoter/1.7.4"}
created2018-01-27 05:41:15
last_update2018-01-27 05:41:15
depth1
children0
last_payout2018-02-03 05:41:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length381
author_reputation12,722,616,650,811
root_title"HTML 5 Tutorial #5 - HTML Attributes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id32,655,448
net_rshares0
@treeplanter ·
Thanks for your donation
Good job! Thanks to @anonteamph00001 you have planted 0.01 tree to save Abongphen Highland Forest in Cameroon. Help me to plant 1,000,000 trees and share my Steem Power to the others. Selfvoting is prohibited, but that should be the reason to spread the world to protect our precious environment. Check out profile of our conservation association @kedjom-keku and the founder/coordinator @martin.mikes to get more information about our conservation program. My current SP is 14515.67. Help me to plant more trees with your delegated SP. 

Thanks a lot,
your @treeplanter 
[www.kedjom-keku.com](www.kedjom-keku.com)
properties (22)
authortreeplanter
permlinkre-cj23-html-5-tutorial-5-html-attributes-20180127t235621715z
categorysteemit
json_metadata{}
created2018-01-27 23:56:21
last_update2018-01-27 23:56:21
depth1
children0
last_payout2018-02-03 23:56:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length614
author_reputation62,929,728,687,402
root_title"HTML 5 Tutorial #5 - HTML Attributes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id32,862,549
net_rshares0