CSS Property Value How to - max-width: 100%;








Question

We would like to know how to max-width: 100%;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
img {<!--from   w ww .  j a v  a 2  s .c o  m-->
  width: 100%;
  max-width: 100%;
}
</style>
</head>
<body>
  <img src="http://www.placehold.it/400x400">
</body>
</html>

The code above is rendered as follows: