class background image not displayed in div

I am quite new to web designing and I am having issue with setting an image as background for a div. I then want add some text inside this div which then appear on top the image.
I am building an angular project with of course html and css.

these are my css and html code snippet

.gbimage {
  height: 100%;
  width: 100%;
  color: #314eb8af;
}

.gbimage div {
  background-image: url("/assets/img/book1.jpg");
  background-repeat: no-repeat;
}
<!doctype html>
<html lang="en">

<body>
  <div class="gbimage">
    <div>
      <a href="#">text number 1</a>
      <a href="#">text number 2</a>
      <a href="#">text number 3</a>
      <a href="#">text number 4</a>
      <a href="#">text number 5</a>
    </div>

  </div>

</body>

</html>

This is how add the css file to home.component.ts file.

@Component({
    selector: 'app-home',
    templateUrl: './home.component.html',
    styleUrls: ['./home.component.css']
  })
  export class HomeComponent  {
}

this is my project structure

inside the home folder are all the home file mentioned above. inside
the assets folder are the images. The home folder is inside the app
folder. the assets folder and the app folder are on the same level,
inside the src folder, one level above the home folder.

2

As question includes several points I will try to tackle them all:

I am having issue with setting an image as background for a div

In order to display the image as background, you need to ensure that the div takes up space. Currently, the inner div where the background image is applied does not have a specified height or width, which means it might not be visible. You need to ensure that this div is given a size to display the background image.

I then want add some text inside this div which then appear on top the image

You need to check the positioning the text on top of the image. By default, the text might appear below the image or outside the image area. To ensure the text is positioned on top of the image, we can use relative or absolute positioning.

The code snippet:

.gbimage {
  height: 100%;
  width: 100%;
  position: relative;
  color: #fff;
}

.gbimage div {
  height: 500px;
  width: 100%;
  background-image: url("https://img.freepik.com/free-photo/sports-car-driving-asphalt-road-night-generative-ai_188544-8052.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gbimage div a {
  margin: 0 10px;
  color: #ffffff;
  font-size: 18px;
  text-decoration: none;
}
<div class="gbimage">
  <div>
    <a href="#">text number 1</a>
    <a href="#">text number 2</a>
    <a href="#">text number 3</a>
    <a href="#">text number 4</a>
    <a href="#">text number 5</a>
  </div>
</div>

As your folder structure is like:

src/
  ├── app/
  │     ├── home/
  │     │     ├── home.component.ts
  │     │     ├── home.component.html
  │     │     ├── home.component.css
  ├── assets/
  │     ├── img/
  │     │     ├── book1.jpg

it might already work, but even not, you need to ensure that Angular is picking up the image correctly. Angular uses the /assets/ folder by default for serving static assets. The path /assets/img/book1.jpg should work correctly, but double-check the image name and folder structure to make sure it’s accurate.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật