<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><img src="https://1.bp.blogspot.com/-Av0kAT_dnSU/V5h9TuuQjvI/AAAAAAAABWk/mW9LokxjfL4vUSgRULbbdLvLs8oQR4yKwCLcB/s1600/tim.pt-br.jpg" alt="Tim Berners-Lee" /></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 "source"). Do you get the picture? Notice how the <code>img</code> element is opened and closed using the same tag. Like the <code><br /></code> tag, it is not tied to a piece of text. "david.jpg" is the name of the image file you want to insert in your page. ".jpg" is the file type of the image. Just like the extension ".htm" shows that a file is an HTML document, ".jpg" 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 "Save picture as..." in the menu that appears.</li> <li>Choose a location for the image on your computer and press "Save".</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><img src="images/logo.png" /></code></p> <p> <strong>Example 3:</strong> </p> <p> <code><img src="https://1.bp.blogspot.com/-Av0kAT_dnSU/V5h9TuuQjvI/AAAAAAAABWk/mW9LokxjfL4vUSgRULbbdLvLs8oQR4yKwCLcB/s1600/tim.pt-br.jpg" /></code></p> <p> Second, images can be links:</p> <p> <strong>Example 4:</strong> </p> <p> <code><a href="https://steemit.com/html/@sahriarbappy/tutorial-html-lesson-9-images"><br /> <img src="https://1.bp.blogspot.com/-Av0kAT_dnSU/V5h9TuuQjvI/AAAAAAAABWk/mW9LokxjfL4vUSgRULbbdLvLs8oQR4yKwCLcB/s1600/tim.pt-br.jpg" /></a></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><img src="logo.gif" alt="My Logo" /></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><img src="logo.gif" title="Learn HTML" /></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 "Learn HTML from HTML.net" 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><img src="logo.png" width="141px" height="32px" /></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><img src="logo.gif" width="32px" height="32px" /></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>
author | sahriarbappy |
---|---|
permlink | tutorial-html-lesson-9-images |
category | html |
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/"]} |
created | 2016-07-27 09:43:12 |
last_update | 2016-07-27 09:45:42 |
depth | 0 |
children | 9 |
last_payout | 2016-08-26 21:45:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.370 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 8,823 |
author_reputation | 99,528,996,994 |
root_title | "Tutorial HTML lesson 9 Images" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 399,014 |
net_rshares | 617,786,124,639 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
murh | 0 | 1,045,268,599 | 11.33% | ||
slowwalker | 0 | 616,443,317,653 | 100% | ||
sahriarbappy | 0 | 131,157,480 | 100% | ||
datachain | 0 | 42,801,807 | 100% | ||
zulfi125 | 0 | 64,687,508 | 100% | ||
whitemike313 | 0 | 58,891,592 | 100% |
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!
author | cheetah |
---|---|
permlink | re-tutorial-html-lesson-9-images-20160727t094356 |
category | html |
json_metadata | "" |
created | 2016-07-27 09:44:12 |
last_update | 2016-07-27 09:44:12 |
depth | 1 |
children | 1 |
last_payout | 2016-08-26 21:45:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 304 |
author_reputation | 942,693,160,055,713 |
root_title | "Tutorial HTML lesson 9 Images" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 399,035 |
net_rshares | 2,016,108,606 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
cheetah | 0 | 1,993,230,375 | 15% | ||
cheetah20 | 0 | 22,878,231 | 100% |
These work is mine!
author | sahriarbappy |
---|---|
permlink | re-cheetah-re-tutorial-html-lesson-9-images-20160727t094356-20160727t095433600z |
category | html |
json_metadata | {"tags":["html"]} |
created | 2016-07-27 09:54:03 |
last_update | 2016-07-27 09:54:03 |
depth | 2 |
children | 0 |
last_payout | 2016-08-26 21:45:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 19 |
author_reputation | 99,528,996,994 |
root_title | "Tutorial HTML lesson 9 Images" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 399,210 |
net_rshares | 0 |
bookmarking this for later!
author | sisterholics |
---|---|
permlink | re-sahriarbappy-tutorial-html-lesson-9-images-20160727t094655430z |
category | html |
json_metadata | {"tags":["html"]} |
created | 2016-07-27 09:46:54 |
last_update | 2016-07-27 09:46:54 |
depth | 1 |
children | 1 |
last_payout | 2016-08-26 21:45:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 27 |
author_reputation | 26,167,751,243,225 |
root_title | "Tutorial HTML lesson 9 Images" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 399,083 |
net_rshares | 0 |
Thanks!
author | sahriarbappy |
---|---|
permlink | re-sisterholics-re-sahriarbappy-tutorial-html-lesson-9-images-20160727t095332800z |
category | html |
json_metadata | {"tags":["html"]} |
created | 2016-07-27 09:53:00 |
last_update | 2016-07-27 09:53:00 |
depth | 2 |
children | 0 |
last_payout | 2016-08-26 21:45:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 7 |
author_reputation | 99,528,996,994 |
root_title | "Tutorial HTML lesson 9 Images" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 399,195 |
net_rshares | 0 |
Congratulations @sahriarbappy! You have received a personal award! [](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)!
author | steemitboard |
---|---|
permlink | steemitboard-notify-sahriarbappy-20170715t163905000z |
category | html |
json_metadata | {"image":["https://steemitboard.com/img/notifications.png"]} |
created | 2017-07-15 16:39:03 |
last_update | 2017-07-15 16:39:03 |
depth | 1 |
children | 0 |
last_payout | 2017-07-22 16:39:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 602 |
author_reputation | 38,975,615,169,260 |
root_title | "Tutorial HTML lesson 9 Images" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,586,156 |
net_rshares | 0 |
Congratulations @sahriarbappy! You have received a personal award! [](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**!
author | steemitboard |
---|---|
permlink | steemitboard-notify-sahriarbappy-20180715t161817000z |
category | html |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2018-07-15 16:18:18 |
last_update | 2018-07-15 16:18:18 |
depth | 1 |
children | 0 |
last_payout | 2018-07-22 16:18:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,185 |
author_reputation | 38,975,615,169,260 |
root_title | "Tutorial HTML lesson 9 Images" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 64,775,068 |
net_rshares | 0 |
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!
author | steemitboard |
---|---|
permlink | steemitboard-notify-sahriarbappy-20190715t165456000z |
category | html |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2019-07-15 16:54:57 |
last_update | 2019-07-15 16:54:57 |
depth | 1 |
children | 0 |
last_payout | 2019-07-22 16:54:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 636 |
author_reputation | 38,975,615,169,260 |
root_title | "Tutorial HTML lesson 9 Images" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 88,333,187 |
net_rshares | 0 |
Thanks dear for this tutorial
author | zulfi125 |
---|---|
permlink | re-sahriarbappy-tutorial-html-lesson-9-images-20160727t094451817z |
category | html |
json_metadata | {"tags":["html"]} |
created | 2016-07-27 09:44:57 |
last_update | 2016-07-27 09:44:57 |
depth | 1 |
children | 1 |
last_payout | 2016-08-26 21:45:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 29 |
author_reputation | 10,774,037,410 |
root_title | "Tutorial HTML lesson 9 Images" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 399,048 |
net_rshares | 0 |
Thanks
author | sahriarbappy |
---|---|
permlink | re-zulfi125-re-sahriarbappy-tutorial-html-lesson-9-images-20160727t095302800z |
category | html |
json_metadata | {"tags":["html"]} |
created | 2016-07-27 09:52:33 |
last_update | 2016-07-27 09:52:33 |
depth | 2 |
children | 0 |
last_payout | 2016-08-26 21:45:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 6 |
author_reputation | 99,528,996,994 |
root_title | "Tutorial HTML lesson 9 Images" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 399,187 |
net_rshares | 0 |