Building a Static Admin Bar for the Browser
videos

Building a Static Admin Bar for the Browser

Tutorial Details
  • Topic: HTML5 + CSS
  • Difficulty: Beginner
  • Screencast duration: 1 hour 20 mins
This entry is part 2 of 3 in the series Static Admin Bar

Moving on from our .psd tutorial, this collection of screencasts will walk you through building our admin bar for the browser. We have a few obstacles to take into account, and we’ll be exploring some interesting ways of getting round them. Let’s get going!


A Couple of Considerations

There are a couple of things we need to bear in mind before we jump into building this. Firstly, our admin bar is going to rob its parent website of some pixels at the top of the page. If the web site beneath happens to have valuable content at the very top, it’s going to be masked by the admin bar. For this reason, we’ll need to push the whole web page downwards to begin with.

Secondly, we need to bear in mind that our CSS is going to be a valid part of the overal web page. If we’re not careful, it will influence styling beyond the boundaries of our admin bar – not good.

Lastly (and related to the previous point), our admin bar is open to influence from CSS belonging to the parent web page. We’ll need to make sure our markup and presentation is completely autonomous.

Note: These screencasts were recorded in high definition, so feel free to hit that HD button!


Part 1: Basic Markup

Let’s kick things off by organizing the project structure, and laying out some basic markup. We’ll also make some significant changes to our reset.css, and take a quick look at what’s involved with using Gravatar images.

Don’t like ads? Download the video, or subscribe to Webdesigntuts+ screencasts via iTunes!

Useful Resources


Part 2: Initial Styling

Having set out our markup, let’s now establish some styling to make the whole thing look more recognizably ‘admin bar’. We’ll cover some @font-face usage, including the brilliant Web Symbols font for our icons. During the process we’ll also make interesting use of the :first-child , :last-child, and the seldom seen :only-child pseudo selectors.

Don’t like ads? Download the video, or subscribe to Webdesigntuts+ screencasts via iTunes!

Useful Resources


Part 3: Yellow Bits

In this video we’ll tackle the yellow priority button, and the little notification sign. We’ll look at CSS3 gradients, transitions, and to help us with the various browser vendor prefixes we’ll examine some useful online tools.

Don’t like ads? Download the video, or subscribe to Webdesigntuts+ screencasts via iTunes!

Useful Resources


Part 4: Search Form Markup and Styling

It’s time to get the search form looking more respectable. We’ll approach it as semantically as possible using the HTML5 input type="search", and then we’ll look at fixing the presentational problems doing so entails.

Don’t like ads? Download the video, or subscribe to Webdesigntuts+ screencasts via iTunes!

Useful Resources


Part 5: CSS3 Dropdown Menu

We’re now going to use a classic approach to building our dropdown menu in HTML and CSS. We’ll briefly discuss accessibility, and explore some transitional effects to make the whole thing look as smooth as possible.

Don’t like ads? Download the video, or subscribe to Webdesigntuts+ screencasts via iTunes!

Useful Resources


Next Time…

We’re nearly done, but there are a couple of details which need sorting out. There’s the tooltip (watch out for that Quick Tip where we look at the HTML5/CSS3 options available to us). We haven’t properly considered cross-browser compatibility yet, and neither have we actually tested our bar within a genuine HTML web page. Plenty still to do then, stay tuned!

Series Navigation<< Design a Static Admin Bar in PhotoshopQuick Tip: Tooltips, Courtesy of HTML5 Data Attributes >>
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • supprof

    Ian Yates awesome tutorial
    thank you very mutch for this great and profesional work
    i hope there will be more tutorials in the near future.
    thank you very mutch i can’t wait to see what you’ll do next

  • Carlos

    Great tutorial, really looking forward the next part… Hopefully it will come soon!

    • http://www.snaptin.com Ian Yates
      Author

      Thanks Carlos – Friday suit you? :)

      • dj

        Thursday would be better!

  • Chris

    Looks great… I would take off the focus box shadow on the search box for all browsers (I noticed it in chrome). Makes it look weird.

    • http://www.snaptin.com Ian Yates
      Author

      Good point Chris, Webkit browsers do that with an outline property – easily remedied, thanks :)

      #admin-bar ul.search input[type=search]:focus {
        outline: none;
        }
      
  • Sleeman

    Hello Ian , first thanks for this tutorial .
    Second i have wild screen 1680*1050 resolution landscape , so when i hover under the search field ” at the top right ” i can see the drop down menu !!!! something wrong !!!

    • http://www.snaptin.com Ian Yates
      Author

      Good spot! I usually work at that resolution too, but shrink things down for legibility when recording screencasts.. Stupid of me, I should have placed the menu ul initial state left: 9999px; (or even further) instead of left: 999px;.

      Source and demo fixed – thanks :)

  • Pingback: Building a Static Admin Bar for the Browser | Shadowtek | Hosting and Design Solutions

  • Pingback: Building a Static Admin Bar for the Browser | Webdesigntuts+ | Dzker

  • http://madliberation.net Steve

    Wonderful stuff Ian, I always seem to pick up new little hints from your tutorials. Keep them coming!

  • Abdulrahman

    Really it’s great tutorial
    Thank you so much
    I’ve learned a lot
    Thank you again

  • http://www.riak.uk.com Web Design Crawley

    This is great! Thanks cant wait for the next part!

  • Fabrice

    Thanks for the usefull tutorial!
    But how can I add more sub-menu’s?

    Ex.:

    Item 1 -> Item 1.1, Item 1.2 etc

    • http://www.snaptin.com Ian Yates
      Author

      Well, that’s a whole tutorial in itself! I’ll give you a start, then see if you can take it further:

      You’re working on the same principle; you’ll need more nested ul elements holding your submenu items. These will be styled very similarly to the existing dropdowns you’ve made, because they’ll inherit all the background, padding, font-family etc.

      You need to firstly make sure these submenu lists are positioned correctly against their parent li elements. Then, you need to make sure they’re hidden, and only appear when their parent elements are hovered over.

      Here’s a start to the css:

      /*sub menu*/
      #admin-bar ul.controls li.more ul li ul {
      	position: absolute;
      	left: 10000%;
      	top: 0;
      }
      #admin-bar ul.controls li.more ul li:hover ul {
      	left: 100%;
      }
      

      You can see that it positions the submenu ul way off the screen, then brings it properly into position (100% of its parent’s width, over from the left) when needed.

      Bear in mind that you’ll have some fighting on your hands where inherited properties are concerned, there’s quite a bit of tidying up to do now!

      Let me know how you get on :)

  • Allar

    Thanks alot, really enjoyed it. Got some real useful resources.

  • http://www.webjobcentral.com John

    Great resource, thank you.

  • http://google.com Fede

    Hola muy buen trabajo, pero tengo una pregunta, en la parte de las fonts me trabo porque pide la url de las fonts me gustaria saber que hago en esa parte. hay hostings de fonts? o que pongo ahi esa es mi pregunta . Gracias

    PD: soy de argentina estoy usando el traductor de google si falla perdon. Bye

  • Fede

    Hi very good job, but I have a question, the part of the fonts I lock it asks me the url of the fonts I do know I like that part. font is hostings? or you put in here that is my question. thanks

    PS: I’m from Argentina I’m using the google translator fails forgiveness. Bye

    • http://www.snaptin.com Ian Yates
      Author

      Hi Fede – hablo un poco Español, te entiendo bien :)

      I used two web fonts in the tutorial; Droid serif and the Web Symbols font. Droid serif is available through Google Web Fonts and is hosted on their servers. All you need to do is point to the CSS file (before referencing your own), using a link such as this:

      <link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css'>
      

      You can then use the font-family in your css.

      The Web Symbols Font has to be hosted yourself. You can download the font for free, after which you add a @font-face rule to your css in order to use it in your styling. Check out the Fontspring blog for solid information on the @font-face rule.

      I hope that helps!

  • hTqDesigns

    A little correction…
    #admin-bar li.welcome {
    font-family: ‘Droid Serif’, serif;
    font-style: italic;
    }

    and

    #admin-bar li.welcome a {
    font-family: Arial, sans-serif;
    font-style: normal;
    padding: 0 0 0 5px;
    }

    no

    #admin-bar ,welcome {
    font-family: ‘Droid Serif’, serif;
    font-style: italic;
    }

    and

    #admin-bar ,welcome a {
    font-family: Arial, sans-serif;
    font-style: normal;
    padding: 0 0 0 5px;
    }

  • Pingback: 10 Killer Css3 Tutorials | Sizzling Magazine

  • TJ

    Is there a way to keep this fixed on the top of the page? Thank You!