So I'm trying to create my own homepage like google, but I'm having a problem. The search bar on the top left is a google search bar and I don't know how to move it to the center of the page in pic related.
>>53382194
Show code
>>53382385
<html>
<head>
<title> Homepage </title>
</head>
<BODY BACKGROUND="https://i.imgur.com/RKd2Q2V.png?1">
<form method="get" action="http://www.google.com/search">
<input type="text" name="q" size="31"
maxlength="255" value="" />
</form>
</html>
>>53382412
good god
>>53382449
What, I just started
So anyone can help me out?
>>53382660
Well you can only center horizontally I think, so might as well make the search bar inside the image somehow and center it to the image's height?
>>53382660
>search for "css align center page"
>click literally any result
>profit
>>53382757
I did and I still don't get it
>>53382889
Hey anon, you can just make the width of your search bar a percent value, and align like this:
if your search bar is 20% of the screen, margin would be: margin: 50%, 40% 50% 40%.
>>53382984
Just use margin: 0 auto;
Come on, it's not that difficult to google CSS.
>>53382984
Don't listen to me anon, just do: margin: auto; margin-top: (however many pixels you want it to be away from the top, preferably half the image size). And you're done.
>>53383298
image height not size, damnit ill stop now, too tired
>>53383298
where do I put margin: 0 auto; in the code?
Easy OP, <center> it!
>>53383809
yeah but that centers it at the top, I want it in the middle
>>53383770
In the stylesheet.
>>53383937
Where in the style sheet?
input { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%)
>>53384081
Theres two shearch bars now, the search bar you added doesn't even function
>>53382194
>>53382412
>>53384158
>twitch makes a webpage
>>53384229
Why did this even have to drag out this long, I just need help with putting the search bar in the middle of the page. Where do I put margin: 0 auto; in my code?
>>53384321
gb2codeacademy
>>53384349
Thanks anon that was really helpful!
But I'm still waiting for someone to help me out!
:}