CSS/HTML Set Minimum Width and Maximum Width Code For Website - Learn About Website | DaddyFile

0

This example demonstrates how to set a minimum width and a maximum width of an element using a pixel value.


Html Code:

<!DOCTYPE html>
<html>
<head>
<style>
p.one {
    max-width: 400px;
    min-width: 100px;
    background-color: yellow;
}
</style>
</head>
<body>

<h2>Set The max-width and min-width of an Element:</h2>
<p>Resize the browser window to see the effect.</p>

<p class="one">This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.</p>

</body>
</html>








Html Code Result:

Set The max-width and min-width of an Element:

Resize the browser window to see the effect.
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.



Post a Comment

 
Top