Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Set the height and width of an image using percent with CSS
To set the height and width of an image using %, you can try to run the following code −
Example
<!DOCTYPE html>
<html>
<head>
<style>
img {
height: 50%;
width: 50%;
}
</style>
</head>
<body>
<p>Sized image in %</p>
<img src = "https://www.tutorialspoint.com/videotutorials/assets/videos/courses/155/images/course_155_image.png" alt = "CSS" width = "200" height = "200">
</body>
</html> Advertisements
