前提・実現したいこと
現在Youtubeにてtech academy様の初めてのCSS入門講座7-2 背景の指定の応用(CSSの背景)をみて独学しているものです。
動画の受講内容の流れとして概要→コードのサンプル→講師の方の解説しながら自分で入力してみるという流れなのですが背景画像がサンプル通りに作成しているはずなのに反映されなくて調べてみたり間違いないか確認してみたがサンプル通りに入力しています。
画像が表示されないのを解決したいです
大変お手数おかけしますがご協力をお願い申し上げます。
発生している問題・エラーメッセージ
CSSの背景画像が標示されない
エラーメッセージ
該当のソースコード
index.html
<html> <head> <title>Background Properties</title> <link rel="stylesheet" href="page-styles.css"> <link rel="stylesheet" href="style.css"> </head> <body> <div class="box"></div> </body> </html> ```##HTML2 index-2.html ```<!DOCTYPE html> <html> <head> <title>Background Properties</title> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="page-styles.css"> </head> <body> <div class="scroll attch"> <h2>Scroll</h2> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p> <p> There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. </p> </div> <div class="fixed attch"> <h2>Fixed</h2> <p> There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. </p> <p> There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. </p> </div> <div class="local attch"> <p> There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. </p> <p> There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. </p> </div> </body> </html> ```##CSS style.css
box{
background-color: #E4E4E4;
background-image: url('ta.png');
background-repeat: repeat;
}
.scroll{
background-attachment: scroll;/This is the default value/
}
.fixed{
background-attachment: fixed;
}
.local{
background-attachment: local;
}
### 試したこと ファイルパスをダブルクォーテーションで囲んでみたり、クォーテーション無しで読み込みしてみたりしました。 ### 補足情報(FW/ツールのバージョンなど) ここにより詳細な情報を記載してください。
回答2件
あなたの回答
tips
プレビュー