Search field in header next to title and subtitle
-
Another issue I’ve got with my search field is that I’d like for it to be placed in my header to the right (in line with the title and sub title of my blog). That should be possible, right?
Click here for more info.
This is the code in the header:
<?php /* contentheader.php - this file can be overriden in a childtheme creating a file with the same name*/ ?> <div id="wrap"> <div id="accessnav"> [ <a href="#content"><?php _e('Content','basic2col'); ?></a> | <a href="#sidebar"><?php _e('Sidebar','basic2col'); ?></a> ] </div> <div id="header"> <h1><a accesskey="h" href="<?php bloginfo('url'); ?>/"> <span title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></span></a></h1> <p><?php bloginfo('description'); ?></p> <form method="get" id="searchform" action="<?php bloginfo('home');?>/"> <h4 class="search"> <input type="text" value="<?php echo wp_specialchars($s, 1); ?>søg" onblur="if(this.value == '') {this.value = 'søg';}" onfocus="if(this.value == 'søg') {this.value = '';}" name="s" id="s" /> <input type="submit" id="searchsubmit" value="Search" /> </h4> </form> </div> <?php basic2col_navbar(); /*loading navbar.php if it exists*/ ?> <div id="content">
And this is the CSS:
/*searchform*/ #searchform { float:right; display:inline; } #searchform label { display:none; /* Skjuler overskriften p? s?gefeltet - smart! */ font-weight:bold; } #searchform input#s { width:50%; } #searchform input.submit { width:30%; } #accessnav { display:none; } #wrap { background : transparent; max-width:672px; /* 65em oprindeligt */ margin:5px auto; padding:0px; text-align:left; } /*header*/ #header { background : transparent; border-bottom:4px solid #b4b4a8; margin:4px 4px 40px; /* Sidste margin styrer afstanden ned til indholdet */ padding:15px 10px; } #header h1{ /* BLOG TITEL */ padding:0px; font-size:1.4em; display:inline; } #header p { padding:0px; margin:2px 10px; font-size:1.1em; display:inline; }
Any help is greatly appreciated as I’ve spent ages trying to figure this out…
It’s sort of a general issue that I keep running into which is: how to place to elements next to each other: one aligned to the left and the other aligned to the right but both on the same line. Hooow?
Thanks
– Joaquim
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Search field in header next to title and subtitle’ is closed to new replies.