Home C C++ Java Python Perl PHP SQL JavaScript Linux Online Test Forum

Home » Forum » x-Forum » Question

CSS to make images 100% in width

html, body {
    position: absolute;
    margin:0;
   	
    
}

Posted by Ravelo 2018-09-10 19:23:57

Hi Ravelo,

If you want to make width of images 100% then you should put following code in your css file:-

img{
width: 100%; //it will cover ur screen
}

or

img{
width: 500px; //if you want image width 500px;
}

C++ user image Admin posted 2018-09-10 19:29:10

If you want to make width of images 50% 
img{
width: 50%; //it will cover ur screen
}

or

img{
width: 200px; //if you want image width 200px;
}
here online web tutorial is https://www.welookups.com

C++ user image aditya12 posted 2018-09-12 20:48:22

If you want to make all your image 100% you can do something like this
img{
width: 100%;
}

But if you want to make some of the images 100% them use a Class  or an ID

Something like this..

<img src ='./img/image.jpg' class="100" />

now do something like this in the CSS..

img .100{
width: 100%; 
}

C++ user image kwedbh posted 2018-09-19 15:44:24

<html>
<head>
 <style>
 .image{
 max-width:100%; or width:100%;
 }</style>
</head>

<img src="sketch.png" class="image" />
</body>
</html>

MVC software development companies: http://www.ifourtechnolab.com/microsoft-technology	

Regards,
Sherin Mathew
MVC Developer at iFour Technolab Pvt. Ltd.																					

C++ user image Sherin posted 2019-04-03 23:22:42

Your Answer


Ask New Question