Posts

Showing posts from November, 2015

How to use Img Tag's Attribute srcset

The srcset Attribute The srcset attribute, allows us to specify a list of sources for an image, which will be delivered based on the pixel density or size of the user’s screen. So we can say that implementing the srcset attribute is a good way to provide to the browser a set of “suggestions” about the correct behavior it should have with a certain type of image. By doing so, we improve the loading of our page and the experience of our users. Example:  <img src="low-density-photo.jpg" srcset="small-photo.jpg 480w, big-photo.jpg 1024w" />

Anchor Tag's Attribute target="_blank"

What is target="_blank" Definition and usage:  _blank is used to open the document in the new window.This value does not require the use of any frames. "_blank" is popular in web pages which are devoted to links to "other resources on the net". By opening a new window for each resource, the user has a sense of a "main" page and "secondary" pages. Example : <a href="http://google.com/" target="_blank">Google</a>