[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
So I'm trying to create my own homepage like google, but
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 24
Thread images: 3
File: 1.png (568 KB, 1920x931) Image search: [Google]
1.png
568 KB, 1920x931
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.
>>
File: 1.png (12 KB, 578x251) Image search: [Google]
1.png
12 KB, 578x251
>>53383937
Where in the style sheet?
>>
input { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%)
>>
File: Untitled.png (15 KB, 450x231) Image search: [Google]
Untitled.png
15 KB, 450x231
>>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!
:}
Thread replies: 24
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.