max-width: ***; min-width: ***;

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O

The max-width property specifies the maximum width of an element, and the min-width property specifies the minimum width of an element.

The maximum width and minimum width of the iframe can be specified by applying these properties to the IFRAME element.


iframe {
max-width: 500px;
min-width: 400px;
}

Property Value Explanation
max-width length, %, or none the size of the maximum width (the default is none)
min-width length or % the size of the minimum width

Example


<html>
<head>
<title>TAG index</title>

<style type="text/css">

iframe {
width: 100%;
height: 150px;
max-width: 600px;
min-width: 500px;
}

</style>

</head>
<body>

<p>minimum width:500px - maximum width:600px</p>

<p><iframe src="example.html">Alternate content</iframe></p>

</body>
</html>

Output
Example pagenew window