- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Use CSS max-width property for responsive image
You can try to run the following code to implement the max-width property for the responsive image
Example
<!DOCTYPE html> <html> <head> <meta name = "viewport" content = "width = device-width, initial-scale = 1.0"> <style> img { max-width: 100%; height: auto; } </style> </head> <body> <p>To check the effect, you need to resize the browser.</p> <img src = "https://www.tutorialspoint.com/python/images/python-data-science.jpg" alt = "Python Data Science" width = "400" height = "300"> </body> </html>
- Related Articles
- Use CSS width property for responsive image
- Use CSS max-width property responsive for video player
- Use CSS width property for a responsive video player
- CSS max-width property
- The max-width Property in CSS
- Perform Animation on CSS max-width
- CSS width property
- CSS max-height property
- CSS border-image-width
- CSS min-width property
- CSS outline-width property
- Animate CSS width property
- Set min-width and max-width of an element using CSS
- How to create a responsive image with CSS?
- The max-height Property in CSS

Advertisements