MuRRe Posted December 8, 2008 Share Posted December 8, 2008 Hi! First off, I don't know PHP almost at all. I know some Java, but PHP is alot different. I started my own blog, its located at: http://murre.x10hosting.com/ (sorry, in swedish). The problem is, the search bar, I want to be able to get the search bar either just right to "Om bloggen, om oss...", or at all the way at the right, but at the navbar. This is code of the navbar: <div id="navbar"> <ul> <li><a href="<?php echo get_settings('home'); ?>">Home</a></li> <?php wp_list_pages('title_li=&depth=1'); ?> <form method="get" id="search_form" action="<?php bloginfo('home'); ?>/"> <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /> <input type="hidden" id="searchsubmit" value="Search" /> </ul> </div> I just took the form for the search from another php file (i just downloaded a theme) and ctrl-v. I have tried to make it work, but i just can't do it. It comes underneath insted of next to the navigation. Thanks in advance MuRRe Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/ Share on other sites More sharing options...
awpti Posted December 8, 2008 Share Posted December 8, 2008 This has nothing to do with PHP and everything to do with CSS. Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709042 Share on other sites More sharing options...
MuRRe Posted December 8, 2008 Author Share Posted December 8, 2008 This has nothing to do with PHP and everything to do with CSS. Ok, I'm very sorry. So now I REALLY showed how bad I am at this. Any1 know how where I can find an answer? Any1 here knows it directly? Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709050 Share on other sites More sharing options...
premiso Posted December 8, 2008 Share Posted December 8, 2008 I doubt this will work but you can try it: <div id="navbar"> <div id="blah"> <ul> <li><a href="<?php echo get_settings('home'); ?>">Home</a></li> <?php wp_list_pages('title_li=&depth=1'); ?> </div> <div style="float: right"> <form method="get" id="search_form" action="<?php bloginfo('home'); ?>/"> <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /> <input type="hidden" id="searchsubmit" value="Search" /> </div> </ul> </div> To find an answer, I would google CSS align div right or something similiar should be plenty of examples. I just hate CSS cause of how much a pain it is to get right in all the browsers, so yea. Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709053 Share on other sites More sharing options...
gevans Posted December 8, 2008 Share Posted December 8, 2008 You could try asking in the html help or css help forum Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709059 Share on other sites More sharing options...
MuRRe Posted December 8, 2008 Author Share Posted December 8, 2008 I doubt this will work but you can try it: <div id="navbar"> <div id="blah"> <ul> <li><a href="<?php echo get_settings('home'); ?>">Home</a></li> <?php wp_list_pages('title_li=&depth=1'); ?> </div> <div style="float: right"> <form method="get" id="search_form" action="<?php bloginfo('home'); ?>/"> <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /> <input type="hidden" id="searchsubmit" value="Search" /> </div> </ul> </div> To find an answer, I would google CSS align div right or something similiar should be plenty of examples. I just hate CSS cause of how much a pain it is to get right in all the browsers, so yea. Lol, almost. It moved to the right, but didn't move up. I will have to investigate further, Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709063 Share on other sites More sharing options...
gevans Posted December 8, 2008 Share Posted December 8, 2008 <div id="navbar" style="float: left;"> <ul> <li><a href="<?php echo get_settings('home'); ?>">Home</a></li> <?php wp_list_pages('title_li=&depth=1'); ?> </ul> </div <div style="float: right;"> <form method="get" id="search_form" action="<?php bloginfo('home'); ?>/"> <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /> <input type="hidden" id="searchsubmit" value="Search" /> </div> <div style="clear: both;"> </div> something like that should do it Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709081 Share on other sites More sharing options...
MuRRe Posted December 8, 2008 Author Share Posted December 8, 2008 <div id="navbar" style="float: left;"> <ul> <li><a href="<?php echo get_settings('home'); ?>">Home</a></li> <?php wp_list_pages('title_li=&depth=1'); ?> </ul> </div <div style="float: right;"> <form method="get" id="search_form" action="<?php bloginfo('home'); ?>/"> <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /> <input type="hidden" id="searchsubmit" value="Search" /> </div> <div style="clear: both;"> </div> something like that should do it And it "almost" did. The result (in FireFox/IE anyways). http://picasaweb.google.se/marten.cederholm/DifferentStuff#5277250008917872066 Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709094 Share on other sites More sharing options...
gevans Posted December 8, 2008 Share Posted December 8, 2008 <div id="navbar"> <div style="float: left;"> <ul> <li><a href="<?php echo get_settings('home'); ?>">Home</a></li> <?php wp_list_pages('title_li=&depth=1'); ?> </ul> </div> <div style="float: right;"> <form method="get" id="search_form" action="<?php bloginfo('home'); ?>/"> <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /> <input type="hidden" id="searchsubmit" value="Search" /> </div> <div style="clear: both;"> </div> </div> there we go! Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709099 Share on other sites More sharing options...
MuRRe Posted December 8, 2008 Author Share Posted December 8, 2008 <div id="navbar"> <div style="float: left;"> <ul> <li><a href="<?php echo get_settings('home'); ?>">Home</a></li> <?php wp_list_pages('title_li=&depth=1'); ?> </ul> </div> <div style="float: right;"> <form method="get" id="search_form" action="<?php bloginfo('home'); ?>/"> <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /> <input type="hidden" id="searchsubmit" value="Search" /> </div> <div style="clear: both;"> </div> </div> there we go! Can't get it to look nice for me!!! How about this <div id="navbar"> <ul> <li style="float: right;"><form method="get" id="search_form" action="<?php bloginfo('home'); ?>/"> <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /> <input type="hidden" id="searchsubmit" value="Search" /> </form></li> <li><a href="<?php echo get_settings('home'); ?>">Home</a></li> <?php wp_list_pages('title_li=&depth=1'); ?> </ul> </div> But it still gets a little down: http://picasaweb.google.se/marten.cederholm/DifferentStuff#5277252152183380914 Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709103 Share on other sites More sharing options...
mrdamien Posted December 8, 2008 Share Posted December 8, 2008 Add this: style="margin-top:-3px;" to this: <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /> <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" style="margin-top:-3px;" /> Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709118 Share on other sites More sharing options...
MuRRe Posted December 8, 2008 Author Share Posted December 8, 2008 You guys made my day!!! I never thought it would be possible to solve it this quick THNX Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709145 Share on other sites More sharing options...
CroNiX Posted December 8, 2008 Share Posted December 8, 2008 Firebug lets you edit css live in firefox, so you can tweak it and see the changes realtime. Then copy and paste to the css file when its how you want it. Quote Link to comment https://forums.phpfreaks.com/topic/136000-php-wordpress/#findComment-709202 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.