r/csshelp • • May 10 '24

why isn't the background repeating? csshelp

i wanted to create a repeating background for the the webpage, the image appears, but there is only one in the top left. i heard a second opinion say that it is because of the positioning causing the image to repeat over itself endlessly, but any change to it either does nothing, or stops the image from appearing. i have also tried background-repeat: repeat; with no success.

the html part of the code

<div class="bg-image">
  <h1> On Copyright and Intellectual Property </h1>
  <h4> By: Yousif Fouad </h4>
  <div class="content">
    <p> 
      .........
      <br>
      <br>
      .........
      <br>
      <br>
      .........
      <br>
      <br>
      .........
      <br>
      <br>
      .........
      <br>
      <br>
      .........
      <br>
    </p>
  </div>
</div>

the CSS code in question

.bg-image {
  position: relative;
}

.bg-image:before {
  content: ' ';
  position: absolute;
  width: 100px;
  height: 100px;
  opacity: 0.6;
  background-image: url('copyright.png');
  background-size: 100px;
}

.content {
  position: relative;
  margin-left: 15%;
  margin-right: 15%;
  border: solid;
  padding: 10px;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.111em;
}
1 Upvotes

2 comments sorted by