Jump to content

Cre8asiteforums Internet Marketing
and Conversion Web Design


Photo

Header Div Covers Google Cache


  • Please log in to reply
4 replies to this topic

#1 jonbey

jonbey

    Eyes Like Hawk Moderator

  • Moderators
  • 4396 posts

Posted 31 July 2011 - 02:44 PM

I created a little header strip to hold breadcrumbs and search that stays fixed to the top of the page.

html:

<div id="tophat">

</div>


css:

#tophat{
background: #fff;
float: left;
width: 100%;
height: 30px;
position:fixed;
z-index:1000;
top: 0 !important;
left: 0 !important;
border-bottom: 2px solid #0A5784;
padding-bottom: 5px;
}


It looks OK in all browsers I have checked (that is what the zindex stuff is all about) but on Google search cache it obscures the top of the page, covering the cache information.

Any ideas if there is a way to fix?

#2 AbleReach

AbleReach

    Peacekeeper Administrator

  • Site Administrators
  • 6467 posts

Posted 31 July 2011 - 03:23 PM

Yes! This is cool, it you're into this sort of thing.

Change the container of your absolutely positioned element to position: relative.

If your #page container is position: relative, an absolutely positioned element directly inside the #page will treat the top of #page as top: 0.

I didn't need to know this until WordPress came out with the admin bar and messed up my themes. Now I've been going through and making sure elements with absolute positioning have something to keep them from going to top:0 and ending up under the admin bar.

#3 jonbey

jonbey

    Eyes Like Hawk Moderator

  • Moderators
  • 4396 posts

Posted 31 July 2011 - 04:42 PM

Tried that but now it just moves with the rest of the page.

In case you are not seeing the same thing as I am, attached is a screen shot.top_div_overlaps_google_cache.jpg

Edited by jonbey, 31 July 2011 - 04:49 PM.


#4 AbleReach

AbleReach

    Peacekeeper Administrator

  • Site Administrators
  • 6467 posts

Posted 31 July 2011 - 10:36 PM

Hmmm... I see what you mean.

If I were you I would just hide it when looking at the cache. Who else is going to care?

#5 jonbey

jonbey

    Eyes Like Hawk Moderator

  • Moderators
  • 4396 posts

Posted 01 August 2011 - 05:44 AM

Any idea how it can be hidden?



RSS Feed

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users