This section will guide you into a detailled look to the default template markup. You will find explanations, alternatives and tips to help you build it the way you want. For a raw version of this code, go to Quick start guide/Basic markup.
<!DOCTYPE html>
Nothing much to say, this is the HTML5 doctype, clean and easy. Yo.
<!--[if IEMobile 7]><html class="no-js iem7 oldie"><![endif]--> <!--[if (IE 7)&!(IEMobile)]><html class="no-js ie7 oldie" lang="en"><![endif]--> <!--[if (IE 8)&!(IEMobile)]><html class="no-js ie8 oldie" lang="en"><![endif]--> <!--[if (IE 9)&!(IEMobile)]><html class="no-js ie9" lang="en"><![endif]--> <!--[if (gt IE 9)|(gt IEMobile 7)]><!--><html class="no-js" lang="en"><!--<![endif]-->
A little bit crowded, but really usefull: on IE, the conditional comments will output only the <html> node matching the version of Internet Explorer. And for every other browsers, the last one will be used. Therefore, you may target any of these versions of IE in your CSS code using the related selector: .ie7, .ie8, .ie9, .iem7 (for Internet Explorer Mobile 7) and .oldie (for all at once)
<head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
This last line is here to force the use of Google Chrome Frame if installed on Internet Explorer. If not installed, IE6 users will be prompted by the conditional commented line right below <body>.
<title>Developr</title> <meta name="description" content=""> <meta name="author" content=""> <!-- http://davidbcalhoun.com/2010/viewport-metatag --> <meta name="HandheldFriendly" content="True"> <meta name="MobileOptimized" content="320"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
This last section defines several metas to tell mobile browsers how to display the content. If you are not familiar with it, you should read the article in comment, it is really useful.
<!-- For all browsers --> <link rel="stylesheet" href="css/reset.css?v=1"> <link rel="stylesheet" href="css/style.css?v=1"> <link rel="stylesheet" href="css/colors.css?v=1"> <link rel="stylesheet" media="print" href="css/print.css?v=1"> <!-- For progressively larger displays --> <link rel="stylesheet" media="only all and (min-width: 480px)" href="css/480.css?v=1"> <link rel="stylesheet" media="only all and (min-width: 768px)" href="css/768.css?v=1"> <link rel="stylesheet" media="only all and (min-width: 992px)" href="css/992.css?v=1"> <link rel="stylesheet" media="only all and (min-width: 1200px)" href="css/1200.css?v=1"> <!-- For Retina displays --> <link rel="stylesheet" media="only all and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min-device-pixel-ratio: 1.5)" href="css/2x.css?v=1">
Standard stylesheets loading, using media queries sometimes.
<!-- Webfonts --> <link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
This is the font used for thin headlines. If not required, you can drop this line safely.
<!-- Additional styles -->
Place additional style sheets here. Not mandatory, but it is a good habit to get a little organized.
<!-- JavaScript at bottom except for Modernizr --> <script src="js/libs/modernizr.custom.js"></script>
Modernizr is the only javascript loaded in the <head> section, because it should be fired before anything else. All other files are loaded right above </body>, as this is the recommended way to do, mostly for faster page loading. But if you want (or need) all your scripts here, do as you wish!
<!-- For Modern Browsers --> <link rel="shortcut icon" href="img/favicons/favicon.png"> <!-- For everything else --> <link rel="shortcut icon" href="img/favicons/favicon.ico"> <!-- For retina screens --> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/favicons/apple-touch-icon-retina.png"> <!-- For iPad 1--> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/favicons/apple-touch-icon-ipad.png"> <!-- For iPhone 3G, iPod Touch and Android --> <link rel="apple-touch-icon-precomposed" href="img/favicons/apple-touch-icon.png">
A bunch of favicons sizes, every browser will pick the one that fits best. Learn more here: https://gist.github.com/472519
Note that, when using Tinycon, the first favicon will be the one used.
<!-- iOS web-app metas --> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <!-- Startup image for web apps --> <link rel="apple-touch-startup-image" href="img/splash/ipad-landscape.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)"> <link rel="apple-touch-startup-image" href="img/splash/ipad-portrait.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)"> <link rel="apple-touch-startup-image" href="img/splash/iphone.png" media="screen and (max-device-width: 320px)">
This part defines that your webapp is capable of running as a standalone app on iOS, set the status bar color and defines a splash image. If you do not need (or want) this, just remove these lines.
The required files for splash screens are:
<!-- Microsoft clear type rendering --> <meta http-equiv="cleartype" content="on">
Some Internet Explorer type display softening.
<!-- IE9 Pinned Sites: http://msdn.microsoft.com/en-us/library/gg131029.aspx --> <meta name="application-name" content="Developr Admin Skin"> <meta name="msapplication-tooltip" content="Cross-platform admin template."> <meta name="msapplication-starturl" content="http://www.display-inline.fr/demo/developr"> <!-- These custom tasks are examples, you need to edit them to show actual pages --> <meta name="msapplication-task" content="name=Agenda;action-uri=http://www.display-inline.fr/demo/developr/agenda.html;icon-uri=http://www.display-inline.fr/demo/developr/img/favicons/favicon.ico"> <meta name="msapplication-task" content="name=My profile;action-uri=http://www.display-inline.fr/demo/developr/profile.html;icon-uri=http://www.display-inline.fr/demo/developr/img/favicons/favicon.ico">
Internet Explorer 9 pinned site demo. This is just an example, you need to define some real texts and tasks.
</head> <body class="clearfix with-menu with-shortcuts">
The <body> node can take several special classes:
<!-- Prompt IE 6 users to install Chrome Frame --> <!--[if lt IE 7]><p class="message red-gradient simpler">Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
As mentioned above, this will prompt IE6 users to install Google Chrome Frame or a newer browser. Learn more here : http://chromium.org/developers/how-tos/chrome-frame-getting-started.
<!-- Title bar --> <header role="banner" id="title-bar"> <h2>Developr</h2> </header>
The title bar, with your application title. It is also used as a button on mobile devices to display the shortcuts panel.
<!-- Button to open/hide menu --> <a href="#" id="open-menu"><span>Menu</span></a> <!-- Button to open/hide shortcuts --> <a href="#" id="open-shortcuts"><span class="icon-thumbs"></span></a>
These buttons may be placed anywhere, as they are absolutely positioned, but here is a good place, isn't it?
<!-- Main content --> <section role="main" id="main">
The main content block, with the corresponding Aria role
<!-- Visible only to browsers without javascript --> <noscript class="message black-gradient simpler">Your browser does not support JavaScript! Some features won't work as expected...</noscript>
Simple noscript element for browsers with javascript disabled. The template generally works fine without it, but most features will be disabled.
<!-- Main title --> <hgroup id="main-title" class="thin"> <h1>Dashboard</h1> <h2>nov <strong>10</strong></h2> </hgroup>
This markup is optional, you can use a bare <h1>. Just include it in the padded block below then.
<!-- The padding wrapper may be omitted --> <div class="with-padding"> <!-- Main content here --> </div>
This block is optional, you can put your content directly in the #main block, but there will be no padding then. This is on purpose, as some styles may look better without padding.
</section> <!-- End main content -->
End of main content. Note the use of a section element: this is pure semantic, you may use a div as well.
<!-- Side tabs shortcuts --> <ul id="shortcuts" role="complementary" class="children-tooltip tooltip-right"> <!-- Active shortcut --> <li class="current"><a href="./" class="shortcut-dashboard" title="Dashboard">Dashboard</a></li> <!-- Background shortcut --> <li><a href="#" class="shortcut-messages" title="Messages">Messages</a></li> <!-- Disabled shortcut --> <li><span class="shortcut-notes" title="Notes">Notes</span></li> </ul>
Side tabs shortcuts, with some tooltips classes (see related section for more details). Three tabs styles are shown here:
There a several icons bundled with the template, go to the advanced section to learn how to create your own.
<!-- Sidebar/drop-down menu --> <section id="menu" role="complementary">
The navigation menu panel. And the Aria role.
<!-- This wrapper is used by several responsive layouts --> <div id="menu-content">
This wrapper is mostly for tablet display, where the content will scroll in this element.
<header> Administrator </header>
Just a simple header. Put whatever you want here.
<div id="profile"> <img src="img/user.png" width="64" height="64" alt="User name" class="user-icon"> Hello <span class="name">John <b>Doe</b></span> </div>
User profile block. The wrapper div may be replaced by a link, for instance to point to the profile page.
<!-- By default, this section is made for 4 icons, see the doc to learn how to change this, in "basic markup explained" --> <ul id="access" class="children-tooltip"> <!-- Icon with count --> <li><a href="#" title="Messages"> <span class="icon-inbox"></span> <span class="count">2</span> </a></li> <!-- Simple icon --> <li><a href="#" title="Calendar"> <span class="icon-calendar"></span></a> </li> <!-- Disabled icon --> <li class="disabled"> <span class="icon-gear"></span> </li> </ul>
Quick access bar, with icons. To disable icons, use the class disabled.
To change the number of visible icons, edit file style.css and find the selector #access > li, then change the width to whatever you want to fit the desired number of icons.
<!-- Navigation menu goes here -->
Placeholder for your navigation menu content, but it may go anywhere in the menu panel, even above header or profile blocks.
</div> <!-- End content wrapper --> <!-- This is optional --> <footer id="menu-footer"> <!-- Any content --> </footer>
This is an optional block where you can put some additional content, for instance some options switches. It will be always visible on tablet mode, as it is outside the scrolling wrapper.
</section> <!-- End sidebar/drop-down menu -->
Same thing as for main content: the use of a section element is pure semantic, you may use a div as well.
<!-- JavaScript at the bottom for fast page loading --> <!-- Scripts --> <script src="js/libs/jquery-1.8.2.min.js"></script> <script src="js/setup.js"></script>
The two main javascript files, should be loaded before anything else.
<!-- Libs go here -->
Put the required libs here. Note that there is sometimes a specific order - for instance, it is recommended to load the tabs plugin last, as the size normalization will work better.
</body> </html>