• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. Firefox OS apps
  5. Firefox OS Building Blocks
  6. Banners
  7. Status 2.0 implementation

Status 2.0 implementation

In This Article
    1. Live sample
    2. Code
      1. CSS
      2. HTML

This article gives you all you need to implement a v2.0 Status bar (Banner) in your own app.

Live sample

The following gives you an idea of what the rendered Banner would look like:

Code

Here is the code you'll need.

CSS

<link href="(your styles folder)/style/status.css" rel="stylesheet" type="text/css">

The CSS can be found in the Gaia project 2.0 branch under shared/style/status.css. Copy this into your own project, along with the associated resources.

HTML

Note: The CSS inside the <style> element isn't needed for the implementation: it is just for the purposes of this example.

<!doctype html>
<html>
<head>
  <link href="https://mdn.github.io/gaia-2.0-bb/status.css" rel="stylesheet" type="text/css">
  <link href="https://gaia-components.github.io/gaia-icons/gaia-icons-embedded.css" rel="stylesheet" type="text/css">
  <style>
    html, body {
      font-family: sans-serif;
      margin: 0;
      padding: 0;
      font-size: 10px;
      background-color: #fff;
    }
    body {
      background: none;
    }
  </style>
</head>
<body role="application">
  <p dir="ltr">
    <label>
      <input type="checkbox"
        onchange="document.documentElement.dir = this.checked ? 'rtl' : 'ltr'">
      RTL mode
    </label>
  </p>
  <section role="status">
    <p>The Alarm is set for <strong>7 hours</strong> and <strong>14 minutes</strong> from now</p>
  </section>
</body>
</html>

Note: Use <button type="button"> if you don't want your form to be submitted.

 

Document Tags and Contributors

Tags: 
  • 2.0
  • B2G
  • banner
  • building blocks
  • Firefox OS
  • Gaia
  • implementation
  • status
 Contributors to this page: chrisdavidmills
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:57:26 AM