Beispiel:CSS-Hero-1.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche
<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Hero-Images - 1</title>
    <style>
html, body {
    margin: 0;
}

html {
    height: 100vh; 
    overflow-y: hidden;	
    background-image: url(https://wiki.selfhtml.org/images/9/99/TotemPole-4096.jpeg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
}

h1 {
    position: absolute;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    text-align: center;
	font-size: 4em;
	color: navy;
}
footer {
    position: absolute;
bottom: 0.5em;
right: 1em;
color: white;
}
</style>
</head>
<body>
    <h1>Hero-Image mit <code>background-image</code></h1>
<footer>
<a rel="license" hreF="https://commons.wikimedia.org/wiki/File:USA_10315_Monument_Valley_Luca_Galuzzi_2007.jpg">Monument Valley von Luca Galuzzi</a>  (CC BY-SA 3.0)
</footer>
</body>
</html>