{"id":59,"date":"2022-03-19T09:54:28","date_gmt":"2022-03-19T09:54:28","guid":{"rendered":"https:\/\/staging.brightwhiz.com\/?post_type=topic&p=59"},"modified":"2022-03-19T09:54:29","modified_gmt":"2022-03-19T09:54:29","slug":"html-images","status":"publish","type":"topic","link":"http:\/\/local.tutorials\/topic\/html-images\/","title":{"rendered":"HTML – Images"},"content":{"rendered":"\n
They say an image is worth a thousand words and that goes for HTML images too. Images help to enrichen your web pages. You can add images to any web page using the Unlike other tags we have seen so far, the Example:<\/p>\n\n\n\n The tag loads the image resource from the value specified in the src attribute. Images are usually stored on the web server or somewhere on the Internet in a separate folder. By specifying the path and file name the web browser will navigate to the location and load the image where the tag is positioned in the HTML document.<\/p>\n\n\n\n Usually, image formats that you can load are those supported by the web browser. If the image is not supported the browser will download it as though it was any other binary file such as a ZIP file.<\/p>\n\n\n\n The required alt attribute provides an alternate text for an image. This text is displayed instead of the image in the event that the user cannot load the images due to various reasons such as slow connection, a missing image at the specified source, or if the user is using a screen reader.<\/p>\n\n\n\n Typically, the alt attribute value should be something descriptive of the image.<\/p>\n\n\n\n You can use the width and height attributes to specify the display size in pixels.<\/p>\n\n\n\n Example:<\/p>\n\n\n\n You can also use the style attribute to specify the image size. Using the style attribute is not restricted to pixels. Using style also prevents any CSS stylesheets from modifying the image size seeing CSS styles supersede the width and height attribute.<\/p>\n\n\n\n Example:<\/p>\n\n\n\n Note<\/strong>: Always specify the width and height of an image. That way you preserve the page layout and if for any reason the image doesn’t load you still keep the layout. Specifying the image size also improves the web page rendering performance.<\/p>\n","protected":false},"excerpt":{"rendered":" They say an image is worth a thousand words and that goes for HTML images too. Images help to enrichen your web pages. You can add images to any web page using the <img> tag in the following syntax. Unlike other tags we have seen so far, the <img> tag is an empty tag, which […]<\/p>\n","protected":false},"featured_media":43,"comment_status":"open","ping_status":"closed","template":"","meta":[],"categories":[2],"tags":[],"subject":[7,8],"yoast_head":"\n<img><\/code> tag in the following syntax.<\/p>\n\n\n\n
<img src="Image URL or encoded data" [other optional attributes]><\/code><\/pre>\n\n\n\n
<img><\/code> tag is an empty tag, which means that it can contain only a list of attributes and it has no closing tag.<\/p>\n\n\n\n
<!DOCTYPE html>\n<html>\n <head>\n <title>This is document title<\/title> \n <\/head>\t\n <body>\n <p>Image inserted<\/p>\n <img src="logo.png" alt="Brightwhiz.com logo">\n <\/body>\t\n<\/html><\/code><\/pre>\n\n\n\n
The src Attribute<\/h2>\n\n\n\n
Common Image Formats<\/h2>\n\n\n\n
Abbreviation<\/strong><\/td> File Format<\/strong><\/td> File Extension<\/strong><\/td><\/tr> APNG<\/td> Animated Portable Network Graphics<\/td> .apng<\/td><\/tr> GIF<\/td> Graphics Interchange Format<\/td> .gif<\/td><\/tr> ICO<\/td> Microsoft Icon<\/td> .ico, .cur<\/td><\/tr> JPEG<\/td> Joint Photographic Expert Group image<\/td> .jpg, .jpeg, .jfif, .pjpeg, .pjp<\/td><\/tr> PNG<\/td> Portable Network Graphics<\/td> .png<\/td><\/tr> SVG<\/td> Scalable Vector Graphics<\/td> .svg<\/td><\/tr> WebP<\/td> open format for lossy compressed true-color graphics<\/td> .webp<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n The alt Attribute<\/h2>\n\n\n\n
Image Size – Width and Height<\/h2>\n\n\n\n
<img src="logo.png" alt="Brightwhiz.com logo" width="480" height="270"><\/code><\/pre>\n\n\n\n
<img src="logo.png" alt="Brightwhiz.com logo" style="width:480px;height:270px;"><\/code><\/pre>\n\n\n\n