Make the image go behind the text and keep it in center using CSS

前端 未结 7 1485
粉色の甜心
粉色の甜心 2021-02-07 04:10

I am creating a web page, where I have an image that I want to place in the center. On the top of that image I want to have input boxes, labels, and a submit button.

I a

7条回答
  •  独厮守ぢ
    2021-02-07 04:45

    I style my css in its own file. So I'm not sure how you need to type it in as your are styling inside your html file. But you can use the Img{ position: relative Top: 150px; Left: 40px; } This would move my image up 150px and towards the right 40px. This method makes it so you can move anything you want on your page any where on your page If this is confusing just look on YouTube about position: relative

    I also use the same method to move my h1 tag on top of my image.

    In my html5 file my image is first and below that I have my h1 tag. Idk if this effects witch will be displayed on top of the other one.

    Hope this helps.

提交回复
热议问题