私は背景がぼやけているようにしようとしていますが、これを試すと、ページ上のすべてがぼやけてしまいます。私はバックグラウンドの写真がぼんやりしているようにしたい
<!DOCTYPE html>
<html>
<head>
<title>Website</title>
<link rel="stylesheet" type="text/css" href="style2.css">
</head>
<body>
<div class="profil-box">
<img src="bilder/Anders.jpg" class="profil-bilde">
<h1> Anders Magnus Klingsholm </h1>
<h5> CV </h5>
</div>
</body>
</html>
html {
background: url(bilder/copenhagen1.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.profil-box {
width: 400px;
height: 400px;
background: rgba(0,0,0,0.4);
padding: 40px;
color: white;
margin: 0 auto;
margin-top: 140px;
text-align: center;
font-family: "Helvetica Neue", sans-serif;
}
.profil-bilde {
border-radius: 50%;
height: 200px;
width: 200px;
}
完全にすべてのブラウザでサポートされていません。ぼやけた背景が必要な場合は、PhotoshopやGimpのようなプログラムで画像をぼかすことをお勧めします。 – CriticalTheWizard
はい、問題は、子要素に影響を与えることなく、HTMLまたは本文にぼかしを適用できないことです。背景画像を保持する1つのdivを作ることができます。 – sinisake