Skip to content

Commit

Permalink
8. HTML & CSS: Responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
Colleen committed Sep 28, 2015
1 parent 0dacf29 commit 61e7425
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 56 deletions.
10 changes: 6 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<html>
<head>
<title>Bloc Jams</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:400,800,600,700,300">
<link rel="stylesheet" type="text/css" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" type="text/css" href="styles/normalize.css">
<link rel="stylesheet" type="text/css" href="styles/main.css">
<link rel="stylesheet" type="text/css" href="styles/landing.css">
</head>
<body class="landing">
<nav class="navbar">
Expand All @@ -16,18 +18,18 @@
<h1 class="hero-title">Turn the music up!</h1>
</section>

<section class="selling-points">
<div class="point">
<section class="selling-points container">
<div class="point column third">
<span class="ion-music-note"></span>
<h5 class="point-title">Choose your music</h5>
<p class="point-description">The world is full of music; why should you have to listen to music that someone else chose?</p>
</div>
<div class="point">
<div class="point column third">
<span class="ion-radio-waves"></span>
<h5 class="point-title">Unlimited, streaming, ad-free</h5>
<p class="point-description">No arbitrary limits. No distractions.</p>
</div>
<div class="point">
<div class="point column third">
<span class="ion-iphone"></span>
<h5 class="point-title">Mobile enabled</h5>
<p class="point-description">Listen to your music on the go. This streaming service is available on all mobile platforms.</p>
Expand Down
48 changes: 48 additions & 0 deletions styles/landing.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
body.landing {
background-color: rgb(58,23,63);
}

.hero-content {
position: relative;
min-height: 600px;
background-image: url(../assets/images/bloc_jams_bg.jpg);
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}

.hero-content .hero-title {
position: absolute;
top: 40%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
transform: translateY(-50%);
width: 100%;
text-align: center;
font-size: 4rem;
font-weight: 300;
text-transform: uppercase;
letter-spacing: 0.5rem;
text-shadow: 1px 1px 0px rgb(58,23,63);
}

.selling-points {
position: relative;
}

.point {
position: relative;
padding: 2rem;
text-align: center;
}

.point .point-title {
font-size: 1.25rem;
}

.ion-music-note,
.ion-radio-waves,
.ion-iphone {
color: rgb(233,50,117);
font-size: 5rem;
}
84 changes: 32 additions & 52 deletions styles/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
*, *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}

html {
height: 100%;
}
Expand All @@ -8,10 +14,6 @@ body {
min-height: 100%;
}

body.landing {
background-color: rgb(58,23,63);
}

.navbar {
padding: 0.5rem;
background-color: rgb(101,18,95);
Expand All @@ -22,52 +24,30 @@ body.landing {
left: 2rem;
}

.hero-content {
position: relative;
min-height: 600px;
background-image: url(../assets/images/bloc_jams_bg.jpg);
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}

.hero-content .hero-title {
position: absolute;
top: 40%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
transform: translateY(-50%);
width: 100%;
text-align: center;
font-size: 4rem;
font-weight: 300;
text-transform: uppercase;
letter-spacing: 0.5rem;
text-shadow: 1px 1px 0px rgb(58,23,63);
}

.selling-points {
position: relative;
display: table;
width: 100%;
box-sizing: border-box;
}

.point {
display: table-cell;
position: relative;
width: 33.3%;
padding: 2rem;
text-align: center;
}

.point .point-title {
font-size: 1.25rem;
}

.ion-music-note,
.ion-radio-waves,
.ion-iphone {
color: rgb(233,50,117);
font-size: 5rem;
.container {
margin: 0 auto;
max-width: 64rem;
}

/* Medium and small screens (640px) */
@media (min-width: 40rem) {
html { font-size: 112%; }

.column {
float: left;
padding-left: 1rem;
padding-right: 1rem;
}

.column.full { width: 100%; }
.column.two-thirds { width: 66.7%; }
.column.half { width: 50%; }
.column.third { width: 33.3%; }
.column.fourth { width: 25%; }
.column.flow-opposite { float: right; }
}

/* Large screens (1024px) */
@media (min-width: 64rem) {
html { font-size: 120%; }
}

0 comments on commit 61e7425

Please sign in to comment.