Having problem with aligning a search bar under an image.It somehow sticks to a left side of a screen. I’m a newbie to web developing. I tried display: flex and margin methods. https://i.sstatic.net/TMhxgNcJ.png, https://i.sstatic.net/oJs9iR0A.png, https://i.sstatic.net/HlNHDMFO.png.
I expected it to work.
Please help me.
2
Answers
Try putting both the image and the search bar inside the same div, then use
I adjusted the body’s width and height to 100% and applied flex to it. This ensures that the form, being within the body, aligns correctly. I also made some fixes to the HTML attributes, and adjusted the logo’s dimensions while removing the background, so everything should work well now.
more about flex-box