Logo and searchbar colliding
-
So these are my codes to make the logo appear on top in the middle of the page (the logo is 316px × 50px) and the searchbox above it to the right. The problem is the rss button. It goes above the searchbox instead to the right of it. Can someone please tell me what I’m doing wrong here?
#logo { float:left; line-height:0; margin-left: 240px; margin-right: 10px; margin-top: 50px;#topsearch { float:right; margin-bottom: 50px; margin-left: 9px; }#rss { float:right; margin: 0px 0 0 15px; margin-left: 9px;
-
depends on the order they are called. a ‘clear:left;’ or ‘clear:right;’ might help.
Thanks for replying! I never used “clear” before. What does it do? I tried it in both logo and searchbar. it just moves the searchbar more down.
‘clear’ allows floated elements to ‘float’ past obsticles.
ideally, could you post a link to your site?
or post at least the code of your header.php?or get the developer add-on and firefox – a good tool to investigate css and html. for instance, click on CSS in the developer-add-on menu and then on VIEW STYLE INFORMATION. this shows you on mouse-over the borders and styles of the elements on your webpage, and – hopefully – helps you to understand what is blocking what, or what to change. you can also change the css and/or html codes in real-time on the screen – again to see what effects possible changes have.
I haven’t published the pages yet (I’m constantly tweaking stuff) but heres a screenshot of the header http://img509.imageshack.us/img509/2035/headeraa.jpg
I’m trying to get searchbar and rss over the logo in the right but for some reasone they keep sticking down. Oh, and also trying to keep the logo in the center.
and the code:
/**********************************************
Header
***********************************************/#logo { float:left; line-height:0; margin-left: 150px; margin-top: 50px; clear: left; } .blog-title a { float:left; line-height: 0.8; font-size: 42px; letter-spacing: -1px; margin-bottom: 0; text-decoration:none; font-weight:bold; } #header p.description { float:left; font-size: 20px; margin: 9px 0 0 12px; padding: 4px 0 4px 12px; border-left: 2px solid #eee; } #topsearch { float:right; margin-top: 9px; clear: left; } #rss { float: right; margin: 9px 0 0 15px; clear: left; } #custom-header-bg { margin: 0 0 30px; width: 800px; overflow:hidden; line-height:0; }we also need to see the html code (or php code) that you use to display your logo/search/rss.
screenshots are of little use.Ok, sorry. Here it is. I still haven’t figured out how to fix it..
<?php if (!$pageTemplate) { get_header(); $paged = is_paged(); } else $paged = $pageNum=='1'?false:true; $first = true; $lastThumb = ''; if (!$pageTemplate && !$paged) adspace(__('Adspace - Blog home below nav','BigFeature')); if (have_posts()) : while (have_posts()) : the_post(); // Get post type if ($first && !$paged && in_array('Feature Image', $bf_features) && !in_array('featureFrontpage', $bf_misc)) $postType = "feature"; elseif (!$first && !$paged && in_array('Thumbnails', $bf_features)) $postType = "thumb"; else $postType = "normal"; if ($first) { // if feature image if ($postType == "feature") if (!get_image('feature')) $postType = "normal"; ?> <!-- begin #content --> <div id="content"> <?php } if(!$first && $postType == "normal") echo '<div class="postdivider"></div>'; ?> <!-- begin post --> <div id="post-<?php the_ID(); ?>" class="post frontpage <?php echo $postType;?> <?php echo $lastThumb;?> <?php bigfeature_post_class(); ?>"> <?php if ($postType == "normal" || $postType == "thumb") { ?><div class="postimage"><?php if ($image = get_image($postType, true)) { ?><a href="<?php the_permalink() ?>"><?php echo $image; ?></a><?php } ?></div><?php } ?> <?php if($postType == "thumb") { ?><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__ ('Permanent Link to %s', 'BigFeature'), get_the_title())?>" class="thumb-link"><?php the_title(); ?></a></h2><?php } else { ?> <div class="post-title cufonheading"><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__ ('Permanent Link to %s', 'BigFeature'), get_the_title())?>"><?php the_title(); ?></a></h2><?php if ($postType !== "thumb" && in_array('Comment Icon', $bf_meta)) { ?><div class="comment"><?php comments_popup_link('0', '1', '%'); ?></div><?php } echo '</div>'; } ?> <?php meta($postType); ?> <?php /* The content */ bf_excerpts(false,$postType=="thumb"?$bf_thumbnail_numwords:$bf_normalpost_numwords,$postType); ?> </div> <!-- end post --> <?php if($first) { $first = false; adspace(__('Adspace - Below Article','BigFeature')); if (get_option(bf_cufon)) echo '<script type="text/javascript"> Cufon.refresh(); </script>'; } if ($postType == "thumb") { if($lastThumb == "last-thumb") { $lastThumb=''; echo '<div class="clear"></div>'; } else $lastThumb="last-thumb"; } ?> <?php endwhile; ?> <div class="clear"></div> <div class="pagenavigation"> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } elseif (function_exists('wp_page_numbers')) { wp_page_numbers(); } else { ?> <div class="alignleft"><?php next_posts_link(__('« Older Entries','BigFeature')) ?></div> <div class="alignright"><?php previous_posts_link(__('Newer Entries »','BigFeature')) ?></div> <?php } ?> </div> <?php else : ?> <p><?php _e('Not Found','BigFeature'); ?></p> <?php endif; ?> <div class="clear"></div> </div> <!-- end #content --> <?php get_sidebar(); ?> <?php get_footer(); ?>thanks for the index.php, but the interesting html/php code is more likely in the header.php
as i said earlier:or post at least the code of your header.php?
Oh I thought you meant the header in css. Here is the .php. Thank you so much for helping me!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <title><?php bf_title(); ?></title> <?php bf_metaTags(); ?> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/library/css/optionstyles.php" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/library/css/print.css" type="text/css" media="print" /> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php if ($bf_feed_url) echo $bf_feed_url; else bloginfo('rss2_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_head(); ?> </head> <body> <?php bf_top(); ?> <!-- begin #container --> <div id="container" class="clearfix"> <?php bf_top_container(); ?> <!-- begin #header --> <div id="header" class="clearfix"> <?php bf_header(); ?> </div> <!-- end #header --> <?php bf_belowheader(); ?>thanks – i have a demo of your theme running;
just another question: what is the size of your logo image?
the wide logo image seems tointerfere with #rss and #topsearch:
try to add a negative top margin to #rss and #topsearch, so the styles look like this (delete the ‘clear:left;’ again)
#topsearch { float:right; margin-top: -80px; margin-right:35px; } #rss { float:right; margin: -80px 0 0 15px; }could you post another screen shot after the changes?
Thanks! The logo position is the same place now but for some reason the searchbar and rss disappeared. The logo size is w316 x h50 pixels.
last trial:
this is the whole css for the header area:/********************************************** Header ***********************************************/ #logo { float:left; line-height:0; margin-right: 10px; margin-top:50px; margin-left:250px; /* to center logo image */ /* next line only added to simulate size of logo image */ width:316px; height:50px; border: 1px solid #CCFFCC; } /* here: style for .blog-title totally removed */ .blog-title a { float:left; line-height: 0.8; text-indent:-999px; /*removes title text from screen*/ font-size: 42px; letter-spacing: -2px; margin-bottom: 0; text-decoration:none; font-weight:bold; } #header p.description { float:left; font-size: 20px; margin: 9px 0 0 12px; padding: 4px 0 4px 12px; border-left: 2px solid #eee; } #topsearch { float:right; margin-top: -90px; margin-right:40px; } #rss { float:right; margin: 9px 0 0 15px; } #custom-header-bg { margin: 0 0 30px; width: 800px; overflow:hidden; line-height:0; } /**********************************************with all these settings, it looks ok in my setup (theme demo).
it could look different in your blog, particular with such a comlicated theme as BigFeature.
there is unfortunately nothing more that i can try.alchymyth you’re the best!! It works! I studied your code and learned some useful new things. I removed the blog title since I only use a logo.
Thank you!!
phew!!! lol 😉
well done
The topic ‘Logo and searchbar colliding’ is closed to new replies.