Ich versuche, ein Bild als Hintergrund einstellen, aber es passt nicht an Handys:Hintergrundbild erscheint nicht Vollbild auf mobilen
Gibt es eine andere Möglichkeit, es zu ändern, ohne Hintergrundbilder mit einem @media-Attribut zu ändern?
Mein HTML und CSS:
body {
/* Location of the image */
background-image: url(../img/background.jpg);
/* Background image is centered vertically and horizontally at all times */
background-position: center center;
/* Background image doesn't tile */
background-repeat: no-repeat;
/* Background image is fixed in the viewport so that it doesn't move when
the content's height is greater than the image's height */
background-attachment: fixed;
/* This is what makes the background image rescale based
on the container's size */
background-size: cover;
/* Set a background color that will be displayed
while the background image is loading */
background-color: #464646;
}
<!DOCTYPE html>
<html>
<head>
\t <link rel="stylesheet" type="text/css" href="css/style.css">
<title>Title of the document</title>
</head>
<body>
<h1>ALOOOU</h1>
</body>
</html>
Verwenden Sie Körper {Höhe: 100vh;} –
das funktioniert, aber jetzt erhalte ich Bildlaufleiste auf Desktop-Ansicht: | – Flash