- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Set the maximum width that a box can be with CSS
The max-width property is used to set the maximum width that a box can be. The value of the max-width property can be a number, a length, or a percentage.
Example
<html> <head> </head> <body> <p style = "max-width:100px; height:200px; border:1px solid green; padding:5px; margin:10px;"> This paragraph is 200px high and max width is 100px This paragraph is 200px high and max width is 100px </p> <img alt = "logo" src = "/css/images/logo.png" width = "100" height = "100" /> </body> </html>
Advertisements