further clarified the purpose of alt text (#32926)
* further clarified the purpose of alt text * fix: removed redundant content
This commit is contained in:
@ -2,20 +2,20 @@
|
||||
title: CSS Images
|
||||
---
|
||||
## CSS Images
|
||||
This helps in adding an image to a website. CSS can handle images like JPG, PNG or other raster format. There are two types images: plain images which are sometimes referenced with a url, and dynamically generated images which are generated by some element.
|
||||
This helps in adding an image to a website. CSS can handle images like JPG, PNG or other raster format. There are two types images: plain images which are sometimes referenced with a url, and dynamically generated images which are generated by some element.
|
||||
|
||||
#### Code Sample
|
||||
|
||||
```<img src="picture.jpg" alt="Picture" width="100" height="100">```
|
||||
|
||||
* **src:** It consists of the value of the path to the required image</li>
|
||||
* **alt:** If the image is not displayed then an alternate text can be displayed using alt attribute.</li>
|
||||
* **width:** This specifies a width for the image(can be percent or px or auto)</li>
|
||||
* **height:** This specifies a height for the image(can be percent or px or auto)</li>
|
||||
* **src:** It consists the value of the path to the required image.
|
||||
* **alt:** This is a text description of the image and is useful if the image cannot be viewed by a visitor. It also allows the image on your page to rank in image search results for search engines such as Google.
|
||||
* **width:** This specifies a width for the image(can be percent or px or auto).
|
||||
* **height:** This specifies a height for the image(can be percent or px or auto).
|
||||
|
||||
#### CSS Defaults
|
||||
|
||||
The `img` element will be rendered by default in most browsers to be displayed as an inline-block display type unless specified otherwise.
|
||||
The `img` element will be rendered by default in most browsers to be displayed as an inline-block display type unless specified otherwise.
|
||||
|
||||
```
|
||||
img {
|
||||
@ -43,7 +43,7 @@ It is advised to change any one parameter, either height or width, to get a prop
|
||||
##### Datatypes
|
||||
<a title="The <image> CSS data type represents a 2D image. There are two kinds of images: plain images, typically referenced using a URL, and dynamically-generated images, like those generated with <gradient> or element(). Images can be used with numerous CSS properties, such as background-image, border-image, content, list-style-image, and cursor." href="/en-US/docs/Web/CSS/image"><code><image></code></a>
|
||||
<a title="The documentation about this has not yet been written; please consider contributing!" href="/en-US/docs/Web/CSS/uri"><code><uri></code></a>
|
||||
|
||||
|
||||
##### Image Sprites
|
||||
An image sprite is a collection of images put into a single image.
|
||||
A web page with many images can take a long time to load and generates multiple server requests.
|
||||
|
Reference in New Issue
Block a user