Week 3: Add Media Queries to Your Style Sheet
This commit is contained in:
parent
3e01fdf14c
commit
b7d10f7af7
|
@ -0,0 +1,67 @@
|
|||
/* base class details */
|
||||
.home_article {
|
||||
margin: 5px;
|
||||
background-color: LightGray;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* Mobile devices */
|
||||
@media screen and (max-width: 480px) {
|
||||
body {
|
||||
background-color: red;
|
||||
}
|
||||
/* hide the right article */
|
||||
#right {W
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* iPads, Tablets. */
|
||||
@media screen and (min-width: 481px) {
|
||||
body {
|
||||
background-color: orange;
|
||||
}
|
||||
/* add radius to article style */
|
||||
.home_article {
|
||||
border-radius: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Small screens, laptops */
|
||||
@media screen and (min-width: 769px) {
|
||||
body {
|
||||
background-color: #589ddb;
|
||||
}
|
||||
/* increase the font size of class piet */
|
||||
.piet {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Desktops, large screens. */
|
||||
@media screen and (min-width: 1025px) {
|
||||
body {
|
||||
background-color: green;
|
||||
}
|
||||
main {
|
||||
display: table;
|
||||
}
|
||||
#left {
|
||||
float: left;
|
||||
width: 47%;
|
||||
}
|
||||
#right {
|
||||
float: right;
|
||||
width: 47%;
|
||||
}
|
||||
.piet {
|
||||
text-shadow: 1px 2px 3px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Extra large screens, TV. */
|
||||
@media screen and (min-width: 1201px) {
|
||||
body {
|
||||
background-color: white;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- The head element contains machine-readable elements -->
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- Page Title tag-->
|
||||
<title>Llewellyn van der Merwe: Week 3</title>
|
||||
<!-- Link tag to stylesheet -->
|
||||
<link href="../css/styles.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<!-- All content goes in the body element -->
|
||||
|
||||
<!-- Header element -->
|
||||
<header>
|
||||
<h1>Llewellyn van der Merwe</h1>
|
||||
<!-- Nav tag -->
|
||||
<nav>
|
||||
<!-- Unordered list tag -->
|
||||
<ul>
|
||||
<!-- list item tag -->
|
||||
<li>
|
||||
<!-- a tag to create a link (empty for now) -->
|
||||
<a href="">Link 1</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">Link 2</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">Link 3</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">Link 4</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<!-- Main element -->
|
||||
<main>
|
||||
<!-- Article element -->
|
||||
<!-- class home_article is set to background color lightgray and padding 10px -->
|
||||
<article id="left" class="home_article">
|
||||
<!-- Header 2 tag -->
|
||||
<h2>First Header</h2>
|
||||
<!-- Paragraph tag -->
|
||||
<p class="piet">Maecenas quis odio sit amet ipsum maximus egestas. Maecenas gravida magna vehicula quam pulvinar varius.
|
||||
Vestibulum venenatis quam enim, a eleifend tortor blandit non. </p>
|
||||
</article>
|
||||
<article id="right" class="home_article">
|
||||
<!-- Header 2 tag -->
|
||||
<h2>Second Header</h2>
|
||||
<!-- Paragraph tag -->
|
||||
<p class="piet">Maecenas quis odio sit amet ipsum maximus egestas. Maecenas gravida magna vehicula quam pulvinar varius.
|
||||
Vestibulum venenatis quam enim, a eleifend tortor blandit non. </p>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
<!-- Footer element -->
|
||||
<footer>
|
||||
<!-- Paragraph tag -->
|
||||
<p>Footer goes here.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue