CSS 2 images with text on top | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

CSS 2 images with text on top

I want to have 2 images take up "exactly half" of the width of the page each. Over the top of these 2 images, I'd like to keep the heading of the page. What have I got wrong? https://code.sololearn.com/WBOIbuJd2W9R/?ref=app

6th Apr 2022, 1:13 AM
Ausgrindtube
Ausgrindtube - avatar
7 Answers
+ 3
https://css-tricks.com/css-basics-using-multiple-backgrounds/
6th Apr 2022, 2:11 AM
Simon Sauter
Simon Sauter - avatar
+ 2
Add this to the css for h1: background-image: url("https://www.w3docs.com/uploads/media/default/0001/01/b408569013c0bb32b2afb0f0d45e93e982347951.jpeg"), url("https://www.w3docs.com/uploads/media/default/0001/01/b408569013c0bb32b2afb0f0d45e93e982347951.jpeg"); background-position: left; background-position: right; background-size: 50%; background-size: 50%;
6th Apr 2022, 2:11 AM
Simon Sauter
Simon Sauter - avatar
+ 2
Simon Sauter with your advice and that link... It clicked. As I was writing the reply *lightbulb*
6th Apr 2022, 3:02 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
17th Apr 2022, 1:16 AM
Ausgrindtube
Ausgrindtube - avatar
0
The problem with putting the code in h1 is that the image only fills the container of h1. Your tip does the split as I want it, but I'd like the images to fill the entire page. I've read the link and it's similar to others I've read, which is why I then posted here - not sure what isn't working in my head that makes my code so poor.
6th Apr 2022, 2:58 AM
Ausgrindtube
Ausgrindtube - avatar
0
Use 50vh 50vw instead
6th Apr 2022, 7:50 AM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
0
Did you solve the problem?
16th Apr 2022, 3:11 AM
Chris Coder
Chris Coder - avatar