You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**4.) Progress Tag**: indicates how much of a task has been completed (often marked as a percentage). It is expected to be modified through JavaScript code.
223
223
@@ -244,7 +244,7 @@ value: If you don\'t specify a value, the first numeric value inside the `<meter
*Note: Using the application caching feature described here is at this point highly discouraged; it\'s in the process of being removed from the Web platform. Use **Service Workers** instead. In fact as of Firefox 44, when AppCache is used to provide offline support for a page a warning message is now displayed in the console advising developers to use Service workers instead (bug 1204581).*
649
649
@@ -1211,7 +1211,7 @@ function toggleFullScreen() {
@@ -2279,7 +2279,53 @@ In addition, while HTML5 defines some rules to follow for an invalid HTML5 docum
2279
2279
<b><a href="#">↥ back to top</a></b>
2280
2280
</div>
2281
2281
2282
-
#### Q. ***Why you would use a srcset attribute in an image tag? Explain the process the browser used when evaluating the content of this attribute.***
2282
+
## Q. ***Why you would use a srcset attribute in an image tag? Explain the process the browser used when evaluating the content of this attribute.***
2283
+
2284
+
The `srcset` attribute allows to define a list of different image resources along with size information so that browser can pick the most appropriate image based on the actual device\'s resolution.
2285
+
2286
+
**Syntax**
2287
+
2288
+
```html
2289
+
<img
2290
+
srcset="
2291
+
url size,
2292
+
url size,
2293
+
url size "
2294
+
src="default url"
2295
+
>
2296
+
```
2297
+
2298
+
### **1. Using display density descriptor**
2299
+
2300
+
`srcset` provides a comma-separated list of image resources along with display density it should be used, for example1x, 2x etc.
2301
+
2302
+
**Example**
2303
+
2304
+
```html
2305
+
<imgsrc="image.jpg"
2306
+
srcset="image.jpg,
2307
+
image_2x.jpg 2x"
2308
+
/>
2309
+
```
2310
+
2311
+
### **2. Using width descriptor**
2312
+
2313
+
The syntax is similar to the display density descriptor, but instead of display density values, we provide the actual width of the image.
2314
+
2315
+
**Example**
2316
+
2317
+
```html
2318
+
<imgsrc="image.jpg"
2319
+
srcset="small.jpg 300w,
2320
+
medium.jpg 600w,
2321
+
large.jpg 900w"
2322
+
/>
2323
+
```
2324
+
2325
+
<divalign="right">
2326
+
<b><a href="#">↥ back to top</a></b>
2327
+
</div>
2328
+
2283
2329
#### Q. ***What is an HTML preprocessor and are you using it?***
2284
2330
#### Q. ***What is WebP?***
2285
2331
#### Q. ***Could you generate a public key in HTML?***
0 commit comments