Css Images
Css Images
Images play an important role in any webpage. Though it is not recommended to include a lot of
images, but it is still important to use good images wherever required.
CSS plays a good role to control image display. You can set the following image properties using
CSS.
<html>
<head>
</head>
<body>
<img style="border:0px;" src="/css/images/logo.png" />
<br />
<img style="border:3px dashed red;" src="/css/images/logo.png" />
</body>
</html>
Here is an example −
<html>
<head>
</head>
<body>
<img style="border:1px solid red; height:100px;" src="/css/images/logo.png" />
<br />
<img style="border:1px solid red; height:50%;" src="/css/images/logo.png" />
</body>
</html>
Here is an example −
<html>
<head>
</head>
<body>
<img style="border:1px solid red; width:150px;" src="/css/images/logo.png" />
<br />
<img style="border:1px solid red; width:100%;" src="/css/images/logo.png" />
</body>
</html>
In Mozilla −moz − opacity: x x can be a value from 0.0 - 1.0. A lower value makes the element more
transparent ThesamethingsgoesfortheCSS3 − validsyntaxopacity: x.
In IE filter: alpha(opacity = x) x can be a value from 0 - 100. A lower value makes the element more
transparent.
Here is an example −
<html>
<head>
</head>
<body>
<img style="border:1px solid red;-moz-opacity:0.4;filter:alpha(opacity=40);"
src="/css/images/logo.png" />
</body>
</html>
Loading [MathJax]/jax/output/HTML-CSS/jax.js