Tell us what’s happening:
Hello, I am new here. I feel lil’ bit nervous as I typed this .
The reason I joined freeCodeCamp is that I want to brush up on my coding/programming skills (especially in web development but not confident enough).
Anyways, I have some questions about this project from Responsive Web Design(Survey Form) , as I would like to make the image half-transparent so the users can read with ease. Uh…I hope this understands the users to solve this issue.
EDIT: Can someone please explain the use of ::before and ::after (content property of CSS) in a simple way?
Feel free to post suggestions or criticisms (don’t pull punches ), thank you
If you use the background image element as a container you can’t set the opacity on the element without affecting the child elements inside it.
You can use an image element instead, or use a pseudo-element (i.e. ::before or ::after). Using a pseudo-element would let you keep the HTML as it is now and you can just adjust the CSS.
Set the form element to be position: relative
Make the .backgroundimgtest into a pseudo-element selector and use the content property to set the image.
Use position: absolute, center it (top/left and transform: translate), set the opacity.