How to put one div tag on top of another?

I am trying to make a website and I have created an div with an image and I want to write something . For that I am thinking of putting another div tag on top of this div tag but it is not working . I think it’s either that the div tag did work but it may be under the image.

#section2{
		background-image: url("dan-gold-4_jhDO54BYg-unsplash.jpg");
		width: 100vw; height: 200vh; background-size: cover;
		/* Ensures the image covers the container */ background-position: center;
		/* Centers the image */
		background-repeat: no-repeat;
		/* Prevents the image from repeating */
		margin:0;
		z-index:500;
		
	}
.part1{
	background-color:blue;
	/*opacity:0.8;*/
	width:100%;
	height:100px;
	display:flex;
	align-items:center;
	justify-content:center;
	z-index:1000;
	
}

You can only use the div selector in CSS.

I can only use the selector in css but using style attribute in html i could avoid using css

That is true for SPA’s single-page applications, usually small, or if that is the way you want to code it. Try to use the correct terminology it helps on FCC. Good luck

1 Like