0

I cant figure out what im doing wrong. My goal is add background picture to article. I created custom.css file with simple code

.main-page-picture {
  background-image: url('/images/main_foto_final.jpg');
  background-color: transparent;
}

<link href for css file is in <head> tag.

picture no show whe i add this to source code in article:

<div>
     <p class="main-page-picture">Text</p>
</div>
2
  • Thank you for posting your question. I feel we need a bit more debugging detail in this question. Please edit your question to show us the relevant portions of your rendered source code (from in your browser). We'll want to see that the css file is actually being linked as intended, and that the targeted <p> tag exists in the html document. Your browser's developer tools should go along way in assisting with these clarifying points. Commented Dec 7, 2021 at 22:47
  • An additional check that you can do is find the targeted element on your webpage, right click it, Inspect it, then manually add your desired stylings directly in the browser. Finally, we'll need to verify that your image file exists and that it exists at the path that you've written. Commented Dec 7, 2021 at 22:47

1 Answer 1

0
.main-page-picture {
background-image: url('/images/main_foto_final.jpg');
background-size:cover;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.