Tôi đã kiểm tra kỹ URL của mình và tên của các tệp, nhưng dường như tôi không thể hiển thị hình ảnh đó. Tại sao nó lại như vậy? Đây là mã của tôi (lưu ý các <p>
là bên trong các thẻ cơ thể, tôi đã không thêm mã đầy đủ, tôi chỉ thêm đầu và vấn đề cụ thể).HTML và CSS Hình nền không hiển thị
<html>
<head>
<title>Head First Lounge.</title>
<link type="text/css"
rel="stylesheet"
href="stylesheet/style.css"
media="screen"/>
</head>
<p class = "guarantee">
Our guarantee: at the lounge, we're committed to providing you,
our guest, with an exceptional experience every time you visit.
Whether you're just stopping by to check in on email over an
elixir, or are here for an out-of-the-ordinary dinner, you'll
find our knowledgeable service staff pay attention to every detail.
If you're not fully satisfied, have a Blueberry Bliss Elixir on us.
</p>
Và đây là quy tắc CSS cho rằng phần
.guarantee{
background-image: url(images/background.gif);
font-family: "Geogia", "Times New Roman", Times, serif;
border-color: black;
border-width: 1px;
border-style: solid;
background-color: #a7cece;
padding: 25px;
margin: 30px;
line-height: 1.9em;
font-style: italic;
color: #444;
}
url của hình ảnh là gì? /images/background.gif hoặc /stylesheet/images/background.gif – KingCronus
nó nằm ở hình ảnh/background.gif. đó là trang HTML chính. – user962206
thay đổi 'background-image: url (../ images/background.gif) ' –