Southern Listeners

Loading
Thanks to Greenlava for this cool gadget. Get yours here

Thursday, November 3, 2011

Non-Floating Header in Blogger Dynamic View

Floating Header
Non-Floating Header

Last week, blog reader boboq88 asked if there is a way to make headers in Dynamic View to sit at one place, instead of floating around your screen. It took me 3 hours to come up with a fix then. Today I received a similar question from blog reader KY_Metro. So here's the fix, to discipline your header and make it sit at one place, instead of floating all around the place.

UPDATE: This tweak will not work on static pages...

If you're using the old Blogger interface: Go to Dashboard - Design - Template Designer - Advanced - Add CSS - paste the following code - Press enter after the last character of the last line } - Apply to Blog.

If you're using the new Blogger interface: Go to Dashboard ('House' symbol) - Template - Customize - Advanced - Add CSS - paste the following code - Press enter after the last character of the last line } - Apply to Blog.
#header .header-bar, #header .header-drawer.sticky, #header .header-drawer{
top: 0px !important;
margin-top: 0px !important;
position: relative !important;
}
body.sidebar #main.hfeed #sidebar{
position: absolute !important;
}
body.sidebar #main.hfeed #sidebar .item{
background: #EEEEEE;
}
#header{
position: relative !important;
}
#header #views{
position: absolute;
}
#header #pages{
left: 110px
}

60 comments:

  1. Hi there,

    First, thanks for all the great customization possible with those new themes. I have added three things :
    - change header picture
    - block dynamic views
    - non-floating header.

    All of this is working very well but it has created a problem on viewing one of my page. On Safari the page appears in the header bar, but only a few pixels can be seen on the bottom of the screen. On Firefox, nothing appears in the header bar.

    Here's the full CSS I've added to get my custom and I'd like to know if I messed one step ... thanks a lot :

    #header .header-drawer.sticky, #header .header-drawer {
    top: 534px;
    }

    #header .header-bar{
    background: white ;
    height: 565px;
    }

    #header:hover .header-drawer, #header .header-drawer.open, .header-ssyby, body.viewitem-open #header .header-drawer {
    top: 565px;
    }

    #header-container {
    height: 605px;
    }

    .viewitem-panel .viewitem-inner {
    top: 500px;
    padding-bottom: 520px !important;
    }

    #header-container #header.header .header-bar span.title{
    background: url(http://farm7.static.flickr.com/6098/6326292095_bbe15173eb_o.png)
    no-repeat center;
    margin-left: auto !important;
    margin-right: auto !important;
    height: 565px;
    }

    #header.header .title a h1, #header.header .title h3{
    display: none;
    }

    #header .header-bar, #header .header-drawer.sticky, #header .header-drawer{
    top: 0px !important;
    margin-top: 0px !important;
    position: relative !important;
    }

    body.sidebar #main.hfeed #sidebar{
    position: absolute !important;
    }

    body.sidebar #main.hfeed #sidebar .item{
    background: #EEEEEE;
    }

    #Classic.ss, #views ul li:first-child ,
    #Flipcard.ss, #views ul li:nth-child(2),
    #Magazine.ss, #views ul li:nth-child(3),
    #Mosaic.ss, #views ul li:nth-child(4),
    #Sidebar.ss, #views ul li:nth-child(5),
    #Snapsnot.ss, #views ul li:nth-child(6),
    #Timeslide.ss, #views ul li:nth-child(7)
    {
    display: none !important;
    }

    ReplyDelete
  2. @YANN: Tried everything I could, but they structured the static pages to appear on top of header image. That means the header image will stick there for all cases, no matter what you do. In a nutshell, this tweak will not work in static pages. I'm terribly sorry.

    ReplyDelete
  3. Thanks a lot ! I think there's nothing to do except waiting their reply about that issue ... I'll keep informed if I get any feedback from Google.

    Thanks again for your custom and your help -

    ReplyDelete
  4. @YANN: I've got a bad news for you. They won't. Trust me, I know Google. I've heard this from one of their staffs myself when I met them during the summit. They said they can't and won't reply to feedbacks. When I find some time for myself, I'll spend few more hours to see if anything else can be done. Until then.

    ReplyDelete
  5. hi

    i'm following along with your list of tweaks too. there are somethings i love about the new dynamic views and some that i absolutely hate. i really want to change my blog over but i won't do it until google allows for more customizations and plug in support. in the mean time keep posting and hacks you discover. they're greatly valued as i experiment with building a new blog.

    ReplyDelete
  6. Hey YoboY, for some reason, my header "pop's" when a Youtube or anything like that scrolls into it. Do you know what causes it, or how to fix it?
    Thanks for the tutorial!

    ReplyDelete
  7. @Anon: Glad you like the tweaks, and thanks for your support :) Cheers.

    @TheMan: Hmm, I'm not quite sure. Do you have a page/post I can have a look at?

    ReplyDelete
  8. Haha, thanks for featuring me in you Gmail post picture! Hope I'm not pestering you. Anyway, if you look at this page:

    http://otcpharmacy.blogspot.com/2011/11/weird-science.html

    The header disappears as the YouTube video goes through it.

    Thanks again!

    ReplyDelete
  9. @TheMan: Haha.. You were one of the latest commentors at that time, that's why your name appeared at the top.

    Back to your question. What browser were you using? I tried with Firefox, Chrome and IE, and the youtube video does not go on top of your header.

    In any case, add this to your CSS and see if it helps:

    #header-container{
    z-index: 99999 !important;
    }

    Cheers.

    ReplyDelete
  10. Thanks for the reply! Hmmm, that's weird it still does it for me, even after using the code. I use both Safari and Chrome, maybe it just happens to me.

    ReplyDelete
  11. YOUR blog is amazing -_- , thank you so much !

    ReplyDelete
  12. @Rouzie: Glad you think that way :)

    ReplyDelete
  13. It turned out not to be working with pages, but with the post's line - it's working for sure.
    How to block floating header in "pages"?

    http://anvilrosenkreuz.blogspot.com/

    ReplyDelete
    Replies
    1. Yeah I've stated that above already. DY's pages are made in a funny way. It is set to appear on top of other pages. If you disable its view, you'd see right through it, and your main page will be visible. It is almost impossible to get rid of the floating header in pages, as of now.

      Delete
    2. Ah, ok, if there a chance to get rid of it, just let me know!

      Thanks, hello from Russia!

      Delete
    3. I most definitely will :) Greetings!

      Delete
  14. this is so great!! I'm a total noob at blogging, and so far all your help with the dynamic view template has been wonderful. Thank you :)

    ReplyDelete
    Replies
    1. Glad you think that way :) Enjoy your stay here..

      Delete
  15. Hello, I have a little problem with the non-floating header in dynamic view.
    I use the Sidebar view for my blog. Since I applied your CSS to my blog, the header stays still. However the sidebar also stays still instead of floating, which is the feature that makes me change to dynamic view. Do you have any solution for this?
    Big thanks for your blog :)

    ReplyDelete
    Replies
    1. I'm sorry Doroke. I tried to make the sidebar floaty when I was first attempting this tutorial. It worked fine, but there was no way to scroll through the sidebar. That means, if you have lots of posts, the users can only click on what is visible, and they won't be able to scroll through ur sidebar to access your older posts. Hope that make sense. That's why I put it this way instead.

      Delete
  16. Más facil con:
    .header-bar, .header-drawer {
    position:absolute !important;
    }

    ReplyDelete
    Replies
    1. Not exactly. That code is incomplete. The code that I posted above covers all possible scenarios (except Static pages). With the code you suggested, some views will look buggy. Sidebar view for example. You'll see a long empty gap at the side. Give it a try and you'll know what I mean.

      Delete
  17. Yoga,

    Thank you so much for your blog. I appreciate it so much.

    Couple of questions.

    I have a large header with a title and was wondering if you know how to reduce the size of the font in the title or move the whole header and font up towards the top? It seems to me when I try and move the header up that the picture moves but the title stays in one place. (www.pastormattrichard.com) I am sure it is due to me being a novice!

    Ever since I made the header stationary with the rest of the page it has helped with viewing. However, when some people click on links to my page the header doesn't behave and doesn't stay in one place. From the main page it works fine but when you enter through links it seems to return to its old habits!

    Again, thank you so much for your website and wisdom.

    PM

    ReplyDelete
  18. Yoga,

    When I looked at my page again... maybe a better question would be, "How can one move the title down underneath the logo?"

    I would like to reduce the font and move the title underneath the logo. I could then reduce the length of my search box and that would save a lot of room.

    Any help would be greatly appreciated!

    ~pm

    ReplyDelete
    Replies
    1. Hi PM,

      There isn't a way to make the header stationary in static pages. That's why I've included a note about static pages before I wrote the tutorial in the post above.

      Now, coming to your questions. I've compiled everything you need in this code :)

      #header .header-bar .title h3 {
      font-size: 15px;
      top: 220px;
      }

      #header-container #header.header .header-bar span.title{
      margin-top: -40px;
      }

      #header input#search{
      width: 200px !important;
      }

      The first code allows you to change the size of your title font, and reposition the title to sit below your header image (manually, as you can tell).

      The second code will 'pull' your header up by 40px. The third code is just to make your search bar a little shorter.

      Let me know if it isn't right.

      Cheers! :)

      Delete
  19. Yoga,

    I find it such a joy to watch people do with ease what they are truly gifted at. Thank you my friend, it means so much to me and my readers!

    PM

    ReplyDelete
    Replies
    1. Hi PM,

      Those are some nicely written words, thanks!

      Delete
  20. Yoga,

    The code worked great. However, now my header won't stick. Any suggestions?

    Here is the code that I have thus far for my header:


    #header .header-drawer.sticky, #header .header-drawer {
    top: 239px;
    }

    #header .header-bar{
    height: 270px;
    }

    #header:hover .header-drawer, #header .header-drawer.open, .header-ssyby, body.viewitem-open #header .header-drawer {
    top: 270px;
    }

    #header.header .header-bar span.title{
    width: 100% !important;
    text-align: center !important;
    }

    .tabs{
    width: 80% !important;
    text-align: center !important;
    }

    #gadget-dock, .ss{
    top: 236px !important;
    }

    #header-container {
    height: 310px;
    }

    .viewitem-panel .viewitem-inner {
    top: 205px;
    padding-bottom: 208px !important;}

    #header-container #header.header .header-bar span.title{
    background: url(http://1.bp.blogspot.com/-pQEa7Ma6wZc/T5LtG9aTl6I/AAAAAAAABZQ/Gd84JruRdMs/s1600/Widerfornewblog.jpg)
    no-repeat center;
    margin-left: auto !important;
    margin-right: auto !important;
    height: 270px;
    }

    #header.header .title a h1, #header.header .title h2{
    display: none;
    }

    .header-bar #search, .ss{
    top: 235px !important;
    }

    #header .header-bar, #header .header-drawer.sticky, #header .header-drawer{
    top: 0px !important;
    margin-top: 0px !important;
    position: relative !important;
    }

    body.sidebar #main.hfeed #sidebar{
    position: absolute !important;
    }

    body.sidebar #main.hfeed #sidebar .item{
    background: #EEEEEE;
    }

    #header .header-bar .title h3 {
    font-size: 19px;
    top: 220px;
    }

    #header-container #header.header .header-bar span.title{
    margin-top: -35px;
    }

    #header input#search{
    width: 130px !important;
    }

    ReplyDelete
    Replies
    1. Guess who decided to change things at their end? Google! I've updated the code in the tutorial above. In your case, just add the following line and things should work as usual once again:

      #header{
      position: relative !important;
      }

      Cheers :)

      Delete
  21. Thanks brother. I guess that keeps you on your toes!

    PM

    ReplyDelete
  22. Hi! I love your tutorials, they have really helped me. This one has been working, but doesn't now. I see that you said google changed things and you updated the code. However, the new code isn't working for me either. I'm not sure what the problem is! Any ideas? Thanks so much!

    ReplyDelete
    Replies
    1. Hi Sarah,

      You were probably seeing a cached copy of your old un-changed page. When I checked your blog, your header is non-sticky as it rightfully should be. If you're still not seeing this, try clearing your cache/cookies of your browser, and try again :)

      Delete
  23. Hi there :)

    Recently chosen the dynamic view for my blog template and your blog has been really helpful so far :)

    I have a couple of questions...

    1) Has blogger made it so the header can be converted to non-floating on static pages yet? Its causing me a nightmare as my header takes up about half of the page, not leaving much space for anything else if not floating... :(
    2) How can I make the posting section on each of my pages lower? At the moment, the top part is cut off a little bit for some reason.
    3)Can I make my posts appear in the relevant pages? So for example, if I write a post about a new lipstick, can I make it so it appears also in my Beauty and Fashion page as well as on my main page?
    4) Is there any way I can include an email subscription widget to my page?
    5) Can I put pictures down the side which link to other sites, such as facebook, Twitter and other blogs?

    Please let me know :) I'm sorry about all the questions, but I'm really terrible at computers and I'm trying to make my blog look good. It's driving me mad. Here's what it looks like right now...
    http://hautefuture.blogspot.co.uk/

    Hope to hear from you soon!
    Love
    GabriellaSofia
    x

    ReplyDelete
    Replies
    1. Hi Gabriella,

      1) Unfortunately, nothing has been done yet - and I don't suppose Blogger is planning to do anything about it. They're just gonna leave it as it is - 'dynamic'..

      2) I can't see the cut-off bit, or probably I'm looking at the wrong place. Mind uploading an annotated screenshot for me?

      3) Not particularly, but there's a workaround. You can't publish posts to a static page. A static page can only accommodate a single entry. If you were planning to publish posts to those empty static pages that you have in your header bar (fashion and beauty, diet and exercise), you might as well delete these pages now.. As for the workaround, you're gonna love this. The trick is to use labels.. Label your posts, and find out the URL for your label.. Here's an example of a label's URL from your blog --> http://hautefuture.blogspot.com/search/label/fashion

      Take this URL, and head over to Dashboard - Pages - New Page - Web Address - and paste the URL there.. You'll end up having this URL in your menu bar. Clicking this link will show all the posts that have this particular label - exactly what you were looking for in the first place!

      4) If by 'page' you meant blog, yes, you can. First, go to feedburner.google.com and create a feed for your blog, if you haven't already done so. Once you've gotten your feed URL, go to Dashboard - Layout - Add a Gadget - Follow by Email - add your feed URL there and save your gadget. You should now see an input field in the 'Subscribe' side gadget in your blog. Screenshot

      5) You mean in your posts? In any case, you can't add social media icons to your template, but you can add them to your posts - manually, one by one. If you have the HTML for it, just edit your posts - switch to HTML view (as opposed to Compose view) - add it there.. There isn't a way to add it globally to the whole template, thus you're gonna have to do it one by one.

      All the best! Cheers :)

      Delete
  24. Hi Yoboy!
    Help...my blog now has a non-floating header (I don't want that) and the header bar flickers. This is only happening with Chrome (on Firefox and Safari...the blog is working perfect). I haven't changed anything to my ccs codes, this just started happening last week. Also the gadget bar doesn't pop out when you hover over it.
    I also noticed that this happens when I view other dynamic views blogs...(checked on 2 different pcs too) is this a chrome issue or can it be corrected someway. I have reported it on the chrome help page...but no response.
    Thank you in advance for your expertise.
    -Marc
    http://shineonandon.blogspot.com/

    ReplyDelete
    Replies
    1. Hi Marc,

      I've seen your blog with my Chrome, and this is what I've gathered..

      1) Your header is floating, just like what I'm seeing in Firefox.
      2) Your gadget dock does pop-out when you hover it.
      3) I don't see any flickering anywhere in your page.
      4) All in all, it looks exactly the same with what I'm seeing in Firefox. Here's a screenshot --> http://i.imgur.com/0YLex.jpg

      The fact that you're seeing these issues in other blogs could indicate a problem with some versions of Chrome. Have you recently upgraded your Chrome? You could try uninstalling and reinstalling your chrome. Since the problem isnt within your blog, there isn't much you can do to fix it.

      Delete
    2. Thank you SO much for your help!
      I will try uninstalling and reinstalling chrome.
      You are the best!
      Thanks again!
      -Marc

      Delete
  25. Hey, thanks a lot. I have used some of your advices in my blog mochiladeviajes to change my header in dynamic views. From now, a big fan of your blog!!! :-)

    ReplyDelete
    Replies
    1. Looking good there.. Keep it up! And enjoy your stay here :)

      Awesome pictures btw.. :)

      Cheers!

      Delete
  26. Hi,

    In Magazine view I seem to be getting an issue when you hover over the different views drop-down, it pushes the top post down.
    You can see it on my page here: http://apps-reviewed.blogspot.com

    Thanks.

    ReplyDelete
    Replies
    1. Hi there,

      Add the following to your Add CSS box:

      #header #views{
      position: absolute;
      }
      #header #pages{
      left: 110px
      }

      Cheers :)

      Delete
  27. Hi Yoga, so far I've learnt tons of blogger customization from you, thanks a lot for that!

    This time, my problem is that this tweak seems to override the "Sticky Header Bar" tweak, since I want both to work.
    Here's what I need: "non-floating header" together with "floating header bar". That's because the header bar carries very important imfo that should be always easily accessible to readers, meanwhile the header should not stick because it eats up so much real estate.

    A million thanks in advance!

    ReplyDelete
    Replies
    1. Hi Giang,

      Sorry for the late reply. I'm afraid keeping the header-bar to float while setting the header to be fixed isn't something that we can easily pull off in Dynamic View templates. Even a non-dynamic template, an integration like this is difficult to be done. But if you're interested, you need to somehow find a way to integrate a plugin called 'Scroll2Fixed' to Dynamic View templates.

      Delete
  28. Oh god! thank youuuuuuuuu! I've been looking for this almost 2 hours!

    ReplyDelete
  29. LOL.. Don't mention it Encover, glad you've found it at last :)

    ReplyDelete
  30. Hi Yoga,
    The code worked well, but if I open a single post, header still float and I can only see apart of post. Can I make header bar non-floating whenever I see single post?
    My blog: http://thunghiemii.blogspot.com/
    Post: http://thunghiemii.blogspot.com/2013/03/bai-chu-1.html
    Thank for your tutorial.

    ReplyDelete
    Replies
    1. Hi Tuan,

      In Dynamic View templates, opening a post page directly using a link has a different effect, compared to viewing the post page view the homepage. Blogger doesn't load all the functionalities when a post page is opened directly using external links, which is why the header is still floating. I'm afraid there isn't much we can do on our side, except to discourage the use of direct post links.

      Delete
  31. Wow, amazing tutorials. I used like 4 of your posts to help get my blog up to where I wanted it to be. Thanks so much for doing all this! I added a photo, moved the header around and re-centered it, and got the header to stick. Thanks again!
    http://usuextensionsustainability.blogspot.com/

    ReplyDelete
  32. Hi there. I have added this and it works fine but... When i enter the link of any post directly from google plus (when i click and when others click at google plus post of my blog's post) the picture doesnt float and the image doesnt opens. Here check for example the first link where it floats, and the second one doesnt:
    http://wallpapercocktail.blogspot.com/
    http://wallpapercocktail.blogspot.com/2014/07/cupcake-1920x1080.html

    ReplyDelete
    Replies
    1. Hi Tony,

      This is a bug that I couldn't find a fix for. When a post is accessed directly, some of the CSS are ignored. More like a flaw in the structure of Dynamic templates itself..

      Delete
  33. You sir, are a lifesaver. Thank you!
    Used a lot of your code to get my header the way I wanted..

    / whatsuprocker.blogspot.com

    ReplyDelete
  34. Hi Im wondering how to set up TWO header images, so one is floating and one IS NOT. I dont know much HTML at all, so can you help? Thanks

    ReplyDelete
    Replies
    1. I'm afraid this is not possible in a Dynamic template. They don't care much for HTMLs as the whole template runs of scripts that are hosted at Google's server.

      Delete
  35. Cheers Yoga for a such vast collection of tips and tweaks. But I can't get this stick header and bar to work on blogger awsome inc template - any chance you could help please BW

    ReplyDelete
    Replies
    1. Hello Adhiraj,

      I believe we have already communicated via the forum. Let me know if you still need help.

      Delete
  36. Thank you so much for the guidance you gave me through this blog, really love it.

    I understand the issue at hand but is there any way to take away the header altogether when viewing pages? The header will not float if it's not even there right? Just thinking hehe.

    Blogpage: http://featherpencilchronicles.blogspot.sg/

    Cheers

    ReplyDelete
  37. Hi Yoga!
    I went to search for html solutions to remove the header in pages view. I found one and placed it into pages html:

    ....

    #header { display:none !important;}

    #main-wrapper { width:742px!important;}

    .post { width:715px!important; }

    ....

    but the result is the page content still edged to where it normally would, though the header is now gone. See it: http://featherpencilchronicles.blogspot.sg/p/test.html

    Any way to push the content up? There's still some sort of container filling the space the header once sat....

    ReplyDelete
    Replies
    1. Hello FP,

      Sorry for the late reply. See if including the following lines to the code above brings your closer to what you're going for?

      .viewitem-inner{
      margin-top: -350px !important;
      }
      .viewitem-panel{
      top: 0px !important;
      }

      Delete

Please use the 'Ask a Question' page to shoot questions that are not related to the tutorial in the post above.