CSSで背景画像を指定する
CSSのbackground-imageプロパティは、背景画像を指定するために使用されます。次のコードを実行して、背景画像を設定してみてください-
<html>
<head>
<style>
#demo {
border: 5px dashed red;
padding: 10px;
background-image: url("https://www.tutorialspoint.com/css/images/css-mini-logo.jpg");
}
</style>
</head>
<body>
<div id="demo">
<h1>www.tutorialspoint.com</h1>
<p>Tutorials Point originated from the idea that there exists a class of readers who respond better to online content and prefer to learn new skills at
their own pace from the comforts of their drawing rooms. The journey commenced with a single tutorial on HTML in 2006 and elated by the response it generated,
we worked our way to adding fresh tutorials to our repository which now proudly flaunts a wealth of tutorials and allied articles on
topics ranging from programming languages to web designing to academics and much more..</p>
</div>
</body>
</html> -
CSSを使用した背景画像の設定
CSSのbackground-imageプロパティは、選択した要素の背景として画像を設定するために使用されます。 構文 CSSbackground-imageプロパティの構文は次のとおりです- Selector { background-image: /*value*/ } 次の例は、CSSのbackground-imageプロパティ-を示しています。 例 <!DOCTYPE html> <html> <head> <style> #demo { margin: 24px; &
-
CSSでぼやけた背景画像を作成するにはどうすればよいですか?
以下は、CSSでぼやけた背景画像を作成するためのコードです- 例 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> body, html { height: 100vh; margin: 0; font-family: "Segoe UI&qu