Skip to content

Instantly share code, notes, and snippets.

@jrudenstam
Created April 9, 2012 14:52
Show Gist options
  • Save jrudenstam/2344023 to your computer and use it in GitHub Desktop.
Save jrudenstam/2344023 to your computer and use it in GitHub Desktop.
Responsive Web Demo
/**
* Responsive Web Demo
*/
html { font-size: 100%; overflow-y: scroll; -webkit-overflow-scrolling: touch; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
body { background: #f5f5f5; margin: 0; font-size: 14px; line-height: 1.75; }
body, button, input, select, textarea { font-family: 'Open Sans', sans-serif; color: #333; text-shadow: 1px 1px 0 #fff;}
a { color: #333; }
a:visited { color: #00376B; }
a:focus { outline: thin dotted; }
a:hover, a:active { outline: 0; }
h1 {font: italic 34px/44px Georgia, "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", serif; margin-top: 0;}
h2 {font-size: 20px; font-weight: 400; line-height: 22px; text-transform: uppercase; margin-top: 0;letter-spacing: 0.05em;}
label {font-style: italic;}
.serif {font-family: Georgia, "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", serif; font-style: italic;}
.sans {font-family: 'Open Sans', sans-serif; font-style: normal;}
nav ul, nav ol { list-style: none; margin: 0; padding: 0; }
/* ================= Initial helpers =========================================*/
.btn {
background: #2d4a88;
background: -moz-linear-gradient(90deg, #2d4a88, #6e85b7);
background: -ms-linear-gradient(90deg, #2d4a88, #6e85b7);
background: -o-linear-gradient(90deg, #2d4a88, #6e85b7);
background: -webkit-gradient(linear, 0 100%, 0 0, from(#2d4a88), to(#6e85b7));
background: -webkit-linear-gradient(90deg, #2d4a88, #6e85b7);
background: linear-gradient(90deg, #2d4a88, #6e85b7);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#2d4a88', EndColorStr='#6e85b7', GradientType=0);
color: #fff;
text-shadow: 1px 1px 0 rgba(0,0,0, 0.25);
}
.img-border { box-shadow: 0 0 10px rgba(0,0,0,0.25); border: 5px solid #fff; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; width: 100%;}
.border-top { border-top: 10px solid #333;}
.border-bottom { border-bottom: 10px solid #333;}
.txt-center {text-align: center;}
.txt-right {text-align: right;}
article {
border-bottom: 1px solid #ddd; border-top: 1px solid #fff;
padding: 40px 0;
}
.first, article:first-of-type {border-top: 0 !important; padding-top: 0;}
.last, article:last-of-type {border-bottom: 0 !important; padding-bottom: 0;}
/* ============== END Initial helpers =========================================*/
img {display: block;}
#container > section {
background: #fff; padding: 20px 0 40px 0;
box-shadow: 0px 20px 10px -20px rgba(0,0,0,0.25) inset,
0px -20px 10px -20px rgba(0,0,0,0.25) inset;
}
.main {padding: 40px 0;}
header {margin-bottom: 20px !important;}
header fieldset p span {margin-right: 10px;}
header img {margin: 20px auto; padding-left: -10px;}
header input[type="email"] {width: 297px;}
.main .border-top {padding-top: 20px;}
.hero { position: relative; padding: 0 !important;}
.hero-txt { font-size: 12px;}
nav select {height: 44px; line-height: 44px; vertical-align: middle; width: 100%; padding: 0 0 0 10px;}
optgroup {color: #e9e9e9; display: none; }
optgroup option{color: #555;}
nav select:focus {outline: none;}
.select-nav {
-webkit-appearance: none;
background: #e9e9e9;
border-top: 1px solid #ccc; border-left: 1px solid #ccc; border-bottom: 1px solid #fff; border-right: 1px solid #fff;
border-radius: 3px;
display: none;
font-size: 22px;
letter-spacing: 1px;
position: relative;
}
.select-nav-wrapper {position: relative; display: none;}
.select-nav-wrapper:after {
background: #ededed;
border-radius: 3px;
border-left: 1px solid #aeaeae; border-right: 1px solid #fff;
box-sizing: border-box;
box-shadow: -2px 0 3px -1px rgba(0,0,0,0.15);
content: url('http://beta.npp.se/img/select_arrow.png');
height: 44px;
position: absolute;
bottom: 0; right: 0;
cursor: pointer;
pointer-events: none;
z-index: 99999;
}
/* Main navigation */
.main-nav {padding: 20px 0; margin-right: 0; width: 245px; height: 388px;}
.main-nav li {margin: 10px 0; height: 77px;}
.main-nav p {
font: italic 14px/17px Georgia, "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", serif;
margin: 0;
}
.main-nav a { font-size: 24px; font-weight: 600; text-transform: uppercase; text-decoration: none; border-bottom: 2px solid #333;}
.main-nav a:visited {color: #333;}
.main-nav .selected {
background: #2d4a88;
background: -moz-linear-gradient(90deg, #2d4a88, #6e85b7);
background: -ms-linear-gradient(90deg, #2d4a88, #6e85b7);
background: -o-linear-gradient(90deg, #2d4a88, #6e85b7);
background: -webkit-gradient(linear, 0 100%, 0 0, from(#2d4a88), to(#6e85b7));
background: -webkit-linear-gradient(90deg, #2d4a88, #6e85b7);
background: linear-gradient(90deg, #2d4a88, #6e85b7);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#2d4a88', EndColorStr='#6e85b7', GradientType=0);
box-shadow: 0 -5px 0 0 rgba(0,0,0,0.05) inset;
color: #fff;
padding: 10px 20px 20px 20px;
position: relative;
height: 77px;
text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}
.main-nav .selected:after {
background: url("http://beta.npp.se/img/select_arrow.png") no-repeat top left;
content: "";
height: 107px; width: 54px;
margin-left: 225px;
position: absolute; top: 0;
z-index: 999999;
}
.main-nav .selected a {color: #fff; border-color: #fff;}
/* Specific elements */
.statement {margin: 20px 0 60px 0;}
.preamble {font-size: 22px; line-height: 32px; padding: 40px;}
.preamble.area:after {
border-color: transparent transparent #fff transparent;
left: 50%;
top: -15px;
}
/* =============================================================================
Non-semantic helper classes
Please define your styles before this section.
========================================================================== */
/* MO Helpers */
.global-width {margin: 0 auto; max-width: 960px;}
.col-1, .col-2, .col-3 {margin-right: 20px;}
.col-1 {width: 225px; margin-right: 20px;}
.col-2 {max-width: 470px;}
.col-3 {max-width: 715px;}
.left {float: left;}
.right {float: right; margin-right: 0;}
/* Contain floats: nicolasgallagher.com/micro-clearfix-hack/ */
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { zoom: 1; }
/* Hidden */
.hidden {display: none; visibility: hidden;}
/* =============================================================================
Responsive styles
========================================================================== */
/* Make 3 column layout here */
@media only screen and (max-width: 960px) and (min-width: 755px) {
/* Main navigation */
.main-nav {width: 715px; height: auto; margin: 0 auto; float: none;}
.main-nav li { padding: 10px 20px 20px 20px; height: auto; border: 1px solid #eee; display: inline-block;}
.main-nav p {display: none;}
.main-nav a {font-size: 14px;}
.main-nav .selected {height: auto;}
.main-nav .selected:after {display: none;}
/* Sub navigation */
.sub-nav ul, .sub-nav .selected, .sub-nav li:hover {list-style: none !important;}
.sub-nav ul {padding: 0;}
.sub-nav > ul > li { display: inline-block; margin-right: 20px;}
.sub-nav li ul li{ display: none;}
.sub-nav li a { padding: 10px; display: inline-block;}
.sub-nav li {background: #fff; border: 1px solid #ddd; margin-bottom: 10px;}
.sub-nav .selected {
background: #2d4a88;
background: -moz-linear-gradient(90deg, #2d4a88, #6e85b7);
background: -ms-linear-gradient(90deg, #2d4a88, #6e85b7);
background: -o-linear-gradient(90deg, #2d4a88, #6e85b7);
background: -webkit-gradient(linear, 0 100%, 0 0, from(#2d4a88), to(#6e85b7));
background: -webkit-linear-gradient(90deg, #2d4a88, #6e85b7);
background: linear-gradient(90deg, #2d4a88, #6e85b7);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#2d4a88', EndColorStr='#6e85b7', GradientType=0);
box-shadow: 0 -5px 0 0 rgba(0,0,0,0.05) inset;
color: #fff;
text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}
.sub-nav .selected a {color: #fff;}
.sub-nav {margin-bottom: 40px !important;}
/* Area */
.area:after {border: 0;}
/* Layout */
.sub-nav, .col-3, .global-width, .main>.left.col-1, .main-header .col-2 { width: 715px !important; margin: 0 auto; float: none; max-width: none; clear: both;}
/* Slider */
.flexslider {max-width: none !important; width: 715px;}
.flex-caption {display: none;}
.flex-control-nav { max-width: 715px; margin: 0 auto; padding: 0 !important; text-align: center;}
}
/* Make 1 column layout here */
@media only screen and (max-width: 755px) {
/* Specific element corrections */
input[type='text'], input[type='email'], textarea {width: 88% !important;}
h1 {
font-size: 22px;
line-height: 30px;
}
.preamble {font-size: 16px; line-height: 26px;}
/* Layout */
.main {padding: 40px 20px;}
.main-nav, .main > .area, .sub-nav {display: none;}
.select-nav-wrapper, .select-nav {display: block;}
.main-header .right {display: none;}
.main-header img {display: block;}
.img-border {margin-bottom: 20px;}
.global-width {padding-right: 20px; padding-left: 20px;}
.hero-wrapper {padding: 0 !important;}
.hero-wrapper .border-top, .hero-wrapper .border-bottom {border: none;}
.hero-txt {padding-right: 20px;}
.col-1 {width: 100%; float: none;}
.col-2, .col-3 {max-width: 100%;}
/* Slider */
.flexslider {max-width: none !important; width: 100%;}
.flex-caption {display: none;}
.flex-control-nav { max-width: 715px; margin: 0 auto; padding: 0 0 0 20px !important; text-align: center;}
}
<div id="container">
<header class="main-header global-width clearfix">
<a class="left col-1" href="#">
<img src="http://www.bluerange.se/F0997E6C7AFB4215A6B101BBC8375251" alt="Logotype" />
</a>
<nav class="select-nav-wrapper">
<select class="select-nav" name="select-nav">
<option selected="selected" value="#">Start</option>
<optgroup label='Main menu'>
<option value=#> » Lorem 1</option>
<option value=#> » Lorem 2</option>
<option value=#> » Lorem 3</option>
<option value=#> » Lorem 4</option>
</optgroup>
</select>
</nav>
</header>
<section>
<div class="hero-wrapper global-width clearfix">
<div class="hero global-width border-top border-bottom clearfix">
<nav class="left main-nav">
<ul>
<li><a href="/referenser/">Lorem 1</a>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing</p>
</li>
<li><a href="/process/">Lorem 2</a>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing</p>
</li>
<li><a href="/nyheter/">Lorem 3</a>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing</p>
</li>
<li>
<a href="/om-oss/">Lorem 4</a>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing</p>
</li>
</ul>
</nav>
<div class="right col-3 flexslider">
<img src="http://beta.npp.se/media/7958/apple-newweb.png" alt="Ny webbplats" />
</div>
</div>
<div class="right txt-right hero-txt">Lorem ipsum dolor sit amet, consectetur adipisicing.</div>
</div>
</section>
<div class="global-width clearfix main" id="main" role="main">
<!-- Columns and statement -->
<div class="right col-3">
<h1 class="txt-center statement">Lorem ipsum dolor sit amet, consectetur adipisicing</h1>
<div class="left col-1 border-top">
<h2>Lorem ipsum</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="left col-1 border-top"> <h2>Lorem ipsum</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="right col-1 border-top"> <h2>Lorem ipsum</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</div>
<footer>
<div class="global-width border-top">
<p class="txt-right">&copy; Lorem ipsum</p>
</div>
</footer>
</div>
{"view":"separate","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment