CSS images


Go to main Page

Images in CSS

We can change the width and height of the image in CSS

We can apply borders to images and many other properties.


Example


       <!DOCTYPE html>

<head>
   
    <title>Document</title>
    <style>
        img{
            width: 300px;
            height: 200px;
            text-align: center;
            border:2px solid red;
        }
    </style>
</head>
<body>
    <img src="https://cdn.pixabay.com/photo/2017/06/21/14/32/jellyfish-2427426__340.jpg">
</body>
</html>