+ 4
How to set background image to fit any screen size?
7 odpowiedzi
+ 4
background-size: cover;
+ 1
Just a simple example:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.responsive {
width: 100%;
height: auto;
}
</style>
</head>
<body>
<h2>Responsive Images</h2>
<p>If you want the image to scale both up and down on responsiveness, set the CSS width property to 100% and height to auto.</p>
<img src="https://via.placeholder.com/150" class="responsive" width="600" height="400">
</body>
</html>
0
background-size: cover;
this could do it
Just like Calviղ said
0
P1NBALL72
n/a is no thing in css.
none is n/a in css
and
Background-color is Tge Color of the background,
Color is the text color.
- 1
Well there are a couple of ways to do it but you could use bootstrap or css like width:5vw; or width:25%;. It just matters what you think is best for your use.
- 1
Plz show me the code