create account

Tutorial HTML lesson 9 Images by sahriarbappy

View this thread on: hive.blogpeakd.comecency.com
· @sahriarbappy · (edited)
$0.37
Tutorial HTML lesson 9 Images
<p> What do you think you can add a picture of Tim Berners-Lee invented the HTML in the center of your page? </p>
<h2>That sounds like a bit of a challenge...</h2>
<p> Maybe, but in fact it is pretty easy to do. All you need is an element: </p>
<p> <strong>Example 1:</strong> </p>
<p> <code>&lt;img src=&quot;https://1.bp.blogspot.com/-Av0kAT_dnSU/V5h9TuuQjvI/AAAAAAAABWk/mW9LokxjfL4vUSgRULbbdLvLs8oQR4yKwCLcB/s1600/tim.pt-br.jpg&quot; alt=&quot;Tim Berners-Lee&quot; /&gt;</code></p>
<p> would look like this in the browser: </p>
<p><img src="https://1.bp.blogspot.com/-Av0kAT_dnSU/V5h9TuuQjvI/AAAAAAAABWk/mW9LokxjfL4vUSgRULbbdLvLs8oQR4yKwCLcB/s1600/tim.pt-br.jpg" /></p>
<p> All you need do is first tell the browser that you want to insert an image<code> (img)</code> and then where it is located (<code>src</code>, short for &quot;source&quot;). Do you get the picture? Notice how the <code>img</code> element is opened and closed using the same tag. Like the <code>&lt;br /&gt;</code> tag, it is not tied to a piece of text. &quot;david.jpg&quot; is the name of the image file you want to insert in your  page. &quot;.jpg&quot; is the file type of the image. Just like the extension  &quot;.htm&quot; shows that a file is an HTML document, &quot;.jpg&quot; tells the browser  that a file is a picture. There are three different types of image file  types you can insert into your pages:  </p>
<ul>
  <li>GIF (Graphics Interchange Format)</li>
  <li>JPG / JPEG (Joint Photographic Experts Group)</li>
  <li>PNG (Portable Network Graphics) </li>
</ul>
<p> <strong>GIF images are usually best for graphics and drawings, while JPEG images are usually better for photographs</strong>.  </p>
<p>This is for two reasons: first, GIF images only consist of 256 colours,  while JPEG images comprise of millions of colours and second, the GIF  format is better at compressing simple images, than the JPEG format  which is optimized for more complex images. The better the compression,  the smaller the size of the image file, the faster your page will load.  As you probably know from your own experience, unnecessarily 'heavy'  pages can be extremely annoying for the user. </p>
<p> Traditionally, the GIF and JPEG formats have been the two dominant image  types, but lately, the PNG format has become more and more popular  (primarily at the expense of the GIF format). </p>
<p><strong>The PNG format contains in many ways the best of both the JPEG and GIF format: millions of colours and effective compressing</strong>. </p>
<h2>Where do I get my images from?</h2>
<p> To make your own images, you need an image editing program. </p>
<p><br /></p>
<p><strong>An image editing program is one of the most essential tools you need to create beautiful websites</strong>.</p>
<p>Unfortunately, no good image editing programs comes with Windows or  other operating systems. Thus, you might consider investing in either  Paint Shop Pro, PhotoShop or Macromedia Fireworks, which are three of  the best image editing programs currently on the market. </p>
<p> However, as we said before, it will not be necessary to buy expensive  programs to complete this tutorial. For now, you can download the  excellent image editing program <a href="http://www.irfanview.com/" rel="noopener">IrfanView</a> which is so-called freeware and therefore costs nothing. </p>
<p> Or you can just borrow images from other sites by downloading them.  But please be careful not to violate copyrights when downloading  pictures. Still, it's useful to know how to download pictures, so here's  how you do it:  </p>
<ol>
  <li>Right-click on an image on any image on the Internet.</li>
  <li>Choose &quot;Save picture as...&quot; in the menu that appears.</li>
  <li>Choose a location for the image on your computer and press &quot;Save&quot;.</li>
</ol>
<p>Do this with the image below and save it on your computer at the  same location as your HTML documents. (Notice that the logo is saved as a  PNG file: logo.png): </p>
<p> Now you can insert the image into one of your own pages. Try it yourself. </p>
<h2>Is that all I need to know about images?</h2>
<p>There are a few more things you should know about images. First, you can easily insert pictures located in other folders, or even pictures that are located on other websites:</p>
<p><strong>Example 2:</strong> </p>
<p> <code>&lt;img src=&quot;images/logo.png&quot; /&gt;</code></p>
<p> <strong>Example 3:</strong> </p>
<p> <code>&lt;img src=&quot;https://1.bp.blogspot.com/-Av0kAT_dnSU/V5h9TuuQjvI/AAAAAAAABWk/mW9LokxjfL4vUSgRULbbdLvLs8oQR4yKwCLcB/s1600/tim.pt-br.jpg&quot; /&gt;</code></p>
<p> Second, images can be links:</p>
<p> <strong>Example 4:</strong> </p>
<p> <code>&lt;a href=&quot;https://steemit.com/html/@sahriarbappy/tutorial-html-lesson-9-images&quot;&gt;<br />
	&lt;img src=&quot;https://1.bp.blogspot.com/-Av0kAT_dnSU/V5h9TuuQjvI/AAAAAAAABWk/mW9LokxjfL4vUSgRULbbdLvLs8oQR4yKwCLcB/s1600/tim.pt-br.jpg&quot; /&gt;&lt;/a&gt;</code></p>
<p> will look like this in the browser (try clicking on the image) </p>
<p><img src="https://1.bp.blogspot.com/-Av0kAT_dnSU/V5h9TuuQjvI/AAAAAAAABWk/mW9LokxjfL4vUSgRULbbdLvLs8oQR4yKwCLcB/s1600/tim.pt-br.jpg" /></p>
<h2>Are there any other attributes I should know about?</h2>
<p>You always need to use the attribute <code>src</code>, which tells  the browser where the image is located. Besides that, there are a number  of other attributes which can be useful when inserting images.</p>
<p>The <code>alt</code> attribute is used to give an alternate  description of an image if, for some reason, the image is not shown for  the user. This is especially important for users with impaired vision,  or if the page is loaded very slowly. Therefore, always use the <code>alt</code> attribute: </p>
<p><strong>Example 5:</strong> </p>
<p> <code>&lt;img src=&quot;logo.gif&quot; alt=&quot;My Logo&quot; /&gt;</code></p>
<p>Some browsers let the text of the alt attribute appear as a small  pop-up box when the user places their cursor over the picture. Please  note that when using the <code>alt</code> attribute, the aim is to provide an alternative description of the picture. The <code>alt</code>  attribute should not be used to create special pop-up messages for the  user since then visually impaired users will hear the message without  knowing what the picture is. </p>
<p>The <code>title</code> attribute can be used to add information to the image: </p>
<p> <strong>Example 6:</strong> </p>
<p> <code>&lt;img src=&quot;logo.gif&quot; title=&quot;Learn HTML&quot; /&gt;</code></p>
<p> Will look like this in the browser: </p>
<p><img src="https://1.bp.blogspot.com/-Av0kAT_dnSU/V5h9TuuQjvI/AAAAAAAABWk/mW9LokxjfL4vUSgRULbbdLvLs8oQR4yKwCLcB/s1600/tim.pt-br.jpg" /></p>
<p> If you, without clicking, place the cursor over the image, you will  see the text &quot;Learn HTML from HTML.net&quot; appear as a pop-up box. Two other important attributes are <code>width</code> and <code>height</code>: </p>
<p><strong>Example 7:</strong> </p>
<p> <code>&lt;img src=&quot;logo.png&quot; width=&quot;141px&quot; height=&quot;32px&quot; /&gt;</code></p>
<p>The <code>width</code> and <code>height</code> attributes can be used to  set the height and width of an image. The value that is used to set the  width and height is pixels. Pixels are the units of measurement used to  measure the resolution of screens. (The most common screen resolution  is 1024x768 pixels). Unlike centimetres, pixels are relative units of  measurement which depend on the resolution of the screen. To a user with  a high screen resolution, 25 pixels may correspond to 1 centimetre,  while the same 25 pixel in a low screen resolution may correspond to 1.5  centimetres on the screen. </p>
<p> If you do not set the width and height, the image will be inserted in  its actual size. But with width and height you can manipulate the size: </p>
<p><strong>Example 8:</strong> </p>
<p><code>&lt;img src=&quot;logo.gif&quot; width=&quot;32px&quot; height=&quot;32px&quot; /&gt;</code></p>
<p> However, it is worth keeping in mind that the actual size in  kilobytes of the image file will remain the same so it will take the  same time to load the image as it did before, even though it appears  smaller on the screen. Therefore, <strong>you should never decrease the image size by using the width and height attributes</strong>. Instead, you should always resize your images in an image editing program to make your pages lighter and faster. </p>
<p>That said, it is still a good idea to use the width and height  attributes because the browser will then be able to detect how much  space the image will need in the final page layout before the image is  fully downloaded. This allows your browser to set up the page nicely in a  quicker way.  That's enough about images for now. </p>
👍  , , , , ,
properties (23)
authorsahriarbappy
permlinktutorial-html-lesson-9-images
categoryhtml
json_metadata{"tags":["html","code","learn","programming","steemit"],"image":["https://1.bp.blogspot.com/-Av0kAT_dnSU/V5h9TuuQjvI/AAAAAAAABWk/mW9LokxjfL4vUSgRULbbdLvLs8oQR4yKwCLcB/s1600/tim.pt-br.jpg"],"links":["http://www.irfanview.com/"]}
created2016-07-27 09:43:12
last_update2016-07-27 09:45:42
depth0
children9
last_payout2016-08-26 21:45:15
cashout_time1969-12-31 23:59:59
total_payout_value0.370 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length8,823
author_reputation99,528,996,994
root_title"Tutorial HTML lesson 9 Images"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id399,014
net_rshares617,786,124,639
author_curate_reward""
vote details (6)
@cheetah ·
Hi! I am a content-detection robot. This post is to help manual curators; I have NOT flagged you.
Here is similar content:
http://html.net/tutorials/html/lesson9.php
NOTE: I cannot tell if you are the author, so ensure you have proper verification in your post (or in a reply to me), for humans to check!
👍  ,
properties (23)
authorcheetah
permlinkre-tutorial-html-lesson-9-images-20160727t094356
categoryhtml
json_metadata""
created2016-07-27 09:44:12
last_update2016-07-27 09:44:12
depth1
children1
last_payout2016-08-26 21:45: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_length304
author_reputation942,693,160,055,713
root_title"Tutorial HTML lesson 9 Images"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id399,035
net_rshares2,016,108,606
author_curate_reward""
vote details (2)
@sahriarbappy ·
These work is mine!
properties (22)
authorsahriarbappy
permlinkre-cheetah-re-tutorial-html-lesson-9-images-20160727t094356-20160727t095433600z
categoryhtml
json_metadata{"tags":["html"]}
created2016-07-27 09:54:03
last_update2016-07-27 09:54:03
depth2
children0
last_payout2016-08-26 21:45: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_length19
author_reputation99,528,996,994
root_title"Tutorial HTML lesson 9 Images"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id399,210
net_rshares0
@sisterholics ·
bookmarking this for later!
properties (22)
authorsisterholics
permlinkre-sahriarbappy-tutorial-html-lesson-9-images-20160727t094655430z
categoryhtml
json_metadata{"tags":["html"]}
created2016-07-27 09:46:54
last_update2016-07-27 09:46:54
depth1
children1
last_payout2016-08-26 21:45: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_length27
author_reputation26,167,751,243,225
root_title"Tutorial HTML lesson 9 Images"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id399,083
net_rshares0
@sahriarbappy ·
Thanks!
properties (22)
authorsahriarbappy
permlinkre-sisterholics-re-sahriarbappy-tutorial-html-lesson-9-images-20160727t095332800z
categoryhtml
json_metadata{"tags":["html"]}
created2016-07-27 09:53:00
last_update2016-07-27 09:53:00
depth2
children0
last_payout2016-08-26 21:45: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_length7
author_reputation99,528,996,994
root_title"Tutorial HTML lesson 9 Images"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id399,195
net_rshares0
@steemitboard ·
Congratulations @sahriarbappy! You have received a personal award!

[![](https://steemitimages.com/70x70/http://steemitboard.com/@sahriarbappy/birthday1.png)](http://steemitboard.com/@sahriarbappy) Happy Birthday - 1 Year on Steemit
Click on the badge to view your own Board of Honor on SteemitBoard.

For more information about this award, click [here](https://steemit.com/steemitboard/@steemitboard/steemitboard-update-8-happy-birthday)
> By upvoting this notification, you can help all Steemit users. Learn how [here](https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png)!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-sahriarbappy-20170715t163905000z
categoryhtml
json_metadata{"image":["https://steemitboard.com/img/notifications.png"]}
created2017-07-15 16:39:03
last_update2017-07-15 16:39:03
depth1
children0
last_payout2017-07-22 16:39: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_length602
author_reputation38,975,615,169,260
root_title"Tutorial HTML lesson 9 Images"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id8,586,156
net_rshares0
@steemitboard ·
Congratulations @sahriarbappy! You have received a personal award!

[![](https://steemitimages.com/70x70/http://steemitboard.com/@sahriarbappy/birthday2.png)](http://steemitboard.com/@sahriarbappy)  2 Years on Steemit
<sub>_Click on the badge to view your Board of Honor._</sub>


**Do not miss the last post from @steemitboard:**
[SteemitBoard World Cup Contest - Play-off for third result](https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-play-off-for-third-result)

---
**Participate in the [SteemitBoard World Cup Contest](https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-collect-badges-and-win-free-sbd)!**
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: [@good-karma](https://v2.steemconnect.com/sign/account-witness-vote?witness=good-karma&approve=1) and [@lukestokes](https://v2.steemconnect.com/sign/account-witness-vote?witness=lukestokes.mhth&approve=1)

---

> Do you like [SteemitBoard's project](https://steemit.com/@steemitboard)? Then **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-sahriarbappy-20180715t161817000z
categoryhtml
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-07-15 16:18:18
last_update2018-07-15 16:18:18
depth1
children0
last_payout2018-07-22 16:18:18
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_length1,185
author_reputation38,975,615,169,260
root_title"Tutorial HTML lesson 9 Images"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,775,068
net_rshares0
@steemitboard ·
Congratulations @sahriarbappy! You received a personal award!

<table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@sahriarbappy/birthday3.png</td><td>Happy Birthday! - You are on the Steem blockchain for 3 years!</td></tr></table>

<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@sahriarbappy) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=sahriarbappy)_</sub>


###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-sahriarbappy-20190715t165456000z
categoryhtml
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2019-07-15 16:54:57
last_update2019-07-15 16:54:57
depth1
children0
last_payout2019-07-22 16:54:57
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_length636
author_reputation38,975,615,169,260
root_title"Tutorial HTML lesson 9 Images"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id88,333,187
net_rshares0
@zulfi125 ·
Thanks dear for this tutorial
properties (22)
authorzulfi125
permlinkre-sahriarbappy-tutorial-html-lesson-9-images-20160727t094451817z
categoryhtml
json_metadata{"tags":["html"]}
created2016-07-27 09:44:57
last_update2016-07-27 09:44:57
depth1
children1
last_payout2016-08-26 21:45: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_length29
author_reputation10,774,037,410
root_title"Tutorial HTML lesson 9 Images"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id399,048
net_rshares0
@sahriarbappy ·
Thanks
properties (22)
authorsahriarbappy
permlinkre-zulfi125-re-sahriarbappy-tutorial-html-lesson-9-images-20160727t095302800z
categoryhtml
json_metadata{"tags":["html"]}
created2016-07-27 09:52:33
last_update2016-07-27 09:52:33
depth2
children0
last_payout2016-08-26 21:45: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_length6
author_reputation99,528,996,994
root_title"Tutorial HTML lesson 9 Images"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id399,187
net_rshares0