Hello World!

This Info-Bar has its visible tab on the far-left.

All that we do to get this, is switch a couple of CSS directives.

Pure CSS Info-Bar (Left Hand Tab Demo)

This page demonstrates the Pure CSS Info-Bar, except with its visible tab on the left. I also removed the box-shadows, as this variant looks more like paper filing to me!

First, move the generated "content" over to the left: .site-notice-bar::before { left: 0; }

If you have a border around your Info-bar (and tab) you will need to shift the generated tab left by the width of your border, to avoid an uneven edge, as I have done in this example.

We also need to move the rounded corners slightly, so there is no bottom-left rounded corner on the Info-Bar, which would spoil the straight line down the left edge into the visible tab. So we reset the corners (border-radius: 0;) and then give the Info-Bar only a rounded bottom-right (border-bottom-right-radius: .5rem;), while the generated tab gets both left and right..

Note how I also moved the margin-top up by .2rem, to avoid having the border show on the page (not that you would see it with this scheme, but it is there!). While I was at it, I moved the Info-Bar text left, to line up better with the tab and overall effect.

Here is the left-hand side variant (notes added)..

Quite paper-like, methinks..
  1. /*
  2. Pure CSS Animated Drop-Down Info-Bar
  3. Left-Hand Tab Version
  4. ;o)
  5. */
  6. .site-notice-bar::before, .site-notice-bar {
  7. transition: all 300ms ease-out;
  8. position: relative;
  9. display: block;
  10. background-color: #f9e7aa;
  11. color: #E8910D;
  12. border: solid .2rem #fbb627;
  13. font-weight: bold;
  14. font-size: 110%;
  15. }
  16. .site-notice-bar {
  17. width: 90%;
  18. padding: 1rem;
  19. margin: 10rem auto 3rem;
  20. border: solid .2rem #FFC44D;
  21. border-radius: .5rem;
  22. -khtml-opacity: 1;
  23. opacity: 1;
  24. }
  25. .site-notice-bar > p {
  26. margin: 1rem auto .5rem 1rem;
  27. /* max-width: 90%;*/
  28. }
  29. @media screen and (min-width: 921px) {
  30. .site-notice-bar::before, .site-notice-bar {
  31. position: absolute;
  32. border-top: none;
  33. border-radius: 0; /* reset corners */
  34. padding: 0;
  35. }
  36. .site-notice-bar::before {
  37. content: attr(data-tab-text);
  38. left: -.2rem; /* this is the tab's left hand position */
  39. margin-top: 12rem;
  40. padding: .5rem 1rem;
  41. cursor: pointer;
  42. z-index: 100;
  43. display: block;
  44. border-bottom-left-radius: .5rem;
  45. border-bottom-right-radius: .5rem;
  46. }
  47. .site-notice-bar {
  48. top: 0;
  49. margin-top: -12.2rem; /* .2rem added to remove visible border */
  50. height: 12rem;
  51. width: 80%;
  52. left: 10%;
  53. z-index: 101;
  54. -khtml-opacity: 0.66;
  55. opacity: 0.66;
  56. border-bottom-right-radius: .5rem; /* no left-hand corner */
  57. }
  58. .site-notice-bar:hover {
  59. margin: 0;
  60. -khtml-opacity: 1;
  61. opacity: 1;
  62. }
  63. }
back to the main page

Make Big Fun Now!

;o)

Welcome to corz.org!

I'm always messing around with the back-end.. See a bug? Wait a minute and try again. Still see a bug? Mail Me!