Sample Website
Code Along
Elements that describe meaning to browser and developer
<div>
<span>Not Semantic
<form>
<table>Semantic
It is common for sites to use code such as this to define structure:
<body>
<div id="nav">
<!--Navigation Content Here-->
</div>
<div id="header">
<!--Header Content Here-->
</div>
<div id="footer">
<!--Footer Content Here-->
</div>
</body>Alternative is to use semantic elements
<body>
<nav>
<!--Navigation Content Here-->
</nav>
<header>
<!--Header Content Here-->
</header>
<footer>
<!--Footer Content Here-->
</footer>
</body>Alternative is to use semantic elements
<article>
<aside>
<details>
<figcaption>
<figure>
<footer>
<header>
<main>
<mark>
<nav>
<section>
<summary>
<time><!DOCTYPE html>
<html>
<head>
<title>COM414 Internet Tech - Home Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>
</body>
</html><!DOCTYPE html>
<html>
<head>
<title>COM414 Internet Tech - Home Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1>COM414 Sample</h1>
</div>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="products.html">Products</a></li>
</ul>
</nav>
</div>
</header>
</body>
</html><!DOCTYPE html>
<html>
<head>
<title>COM414 Internet Tech - Home Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1>COM414 Sample</h1>
</div>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="products.html">Products</a></li>
</ul>
</nav>
</div>
</header>
<section id="showcase">
<div class="container">
<h1>Learn Front-End Internet Technologies</h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book
</p>
</div>
</section>
</body>
</html><!DOCTYPE html>
<html>
<head>
<title>COM414 Internet Tech - Home Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1>COM414 Sample</h1>
</div>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="products.html">Products</a></li>
</ul>
</nav>
</div>
</header>
<section id="showcase">
<div class="container">
<h1>Learn Front-End Internet Technologies</h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book
</p>
</div>
</section>
<section id="news">
<div class="container">
<h1>Subscribe to the Newsletter</h1>
<form>
<input type="email" placeholder="e-mail address">
<button type="submit" class="button1">Subscribe</button>
</form>
</div>
</section>
</body>
</html><!DOCTYPE html>
<html>
<head>
<title>COM414 Internet Tech - Home Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1>COM414 Sample</h1>
</div>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="products.html">Products</a></li>
</ul>
</nav>
</div>
</header>
<section id="showcase">
<div class="container">
<h1>Learn Front-End Internet Technologies</h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book
</p>
</div>
</section>
<section id="news">
<div class="container">
<h1>Subscribe to the Newsletter</h1>
<form>
<input type="email" placeholder="e-mail address">
<button type="submit" class="button1">Subscribe</button>
</form>
</div>
</section>
<section id="topicList">
<div class="container">
<div class="topic">
<img src="logo_html.png">
<h3>HTML5</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.</p>
</div>
<div class="topic">
<img src="logo_css.png">
<h3>CSS3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.</p>
</div>
<div class="topic">
<img src="logo_javascript.png">
<h3>Javascript</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.</p>
</div>
</div>
</section>
</body>
</html><!DOCTYPE html>
<html>
<head>
<title>COM414 Internet Tech - Home Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1>COM414 Sample</h1>
</div>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="products.html">Products</a></li>
</ul>
</nav>
</div>
</header>
<section id="showcase">
<div class="container">
<h1>Learn Front-End Internet Technologies</h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book
</p>
</div>
</section>
<section id="news">
<div class="container">
<h1>Subscribe to the Newsletter</h1>
<form>
<input type="email" placeholder="e-mail address">
<button type="submit" class="button1">Subscribe</button>
</form>
</div>
</section>
<section id="topicList">
<div class="container">
<div class="topic">
<img src="logo_html.png">
<h3>HTML5</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.</p>
</div>
<div class="topic">
<img src="logo_css.png">
<h3>CSS3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.</p>
</div>
<div class="topic">
<img src="logo_javascript.png">
<h3>Javascript</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.</p>
</div>
</div>
</section>
<footer>
<p>Ulster University, Copyright © 2018</p>
</footer>
</body>
</html>body
{
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
line-height: 1.5;
padding: 0;
margin: 0;
background-color: #DDFFF7;
}.container
{
width: 80%;
margin: auto;
/*hide content that spills over size of container*/
/*i.e. dont create scroll bars inside containers*/
overflow: hidden;
}header
{
background-color: #303036;
color: #ffffff;
padding-top: 30px;
min-height: 70px;
border-bottom: #F93943 3px solid;
}header a
{
color: #ffffff;
text-decoration: none;
text-transform: uppercase;
font-size: 16px;
}header ul
{
margin: 0;
padding: 0;
}
header li
{
float: left;
display: inline;
padding: 0 20px 0 20px;
}header #branding
{
float: left;
}
header #branding h1
{
margin: 0;
}
header nav
{
float: right;
margin-top: 10px;
}header .highlight
{
color: #F93943;
font-weight: bold;
}
header .current a
{
color: #F93943;
font-weight: bold;
}...
<div id="branding">
<h1><span class="highlight">COM414</span> Sample</h1>
</div>
<nav>
<ul>
<li class="current"><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="products.html">Products</a></li>
</ul>
</nav>
...header .highlight, header .current a
{
color: #F93943;
font-weight: bold;
}
...
<div id="branding">
<h1><span class="highlight">COM414</span> Sample</h1>
</div>
<nav>
<ul>
<li class="current"><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="products.html">Products</a></li>
</ul>
</nav>
...This is the same as previous slide
header a:hover
{
color: #cccccc;
font-weight: bold;
}#showcase
{
background:url('heroImage2_1.jpg') no-repeat;
background-size: cover;
text-align: center;
color: #ffffff;
}
#showcase
{
background:url('heroImage2_1.jpg') no-repeat;
background-size: cover;
text-align: center;
color: #ffffff;
min-height: 400px;
}
#showcase
{
background:url('heroImage2_1.jpg') no-repeat;
background-size: cover;
text-align: center;
color: #ffffff;
min-height: 400px;
background-attachment: fixed;
}
#showcase h1
{
margin-top: 100px;
font-size: 55px;
margin-bottom: 10px;
}
#showcase p
{
font-size: 20px;
}#showcase
{
min-height: 400px;
background:url('heroImage2_1.jpg') no-repeat;
background-size: cover;
text-align: center;
color: #ffffff;
}
#showcase h1
{
margin-top: 100px;
font-size: 55px;
margin-bottom: 10px;
}
#showcase p
{
font-size: 20px;
}#news
{
padding: 15px;
color: #ffffff;
background-color: #303036;
}
#news h1
{
float: left;
}
#news form
{
float: right;
margin-top: 15px;
}.button1
{
height: 38px;
background-color: #FC5130;
border: 0;
padding-left: 20px;
padding-right: 20px;
color: #ffffff;
}
#news input[type="email"]
{
padding: 4px;
height: 25px;
width: 250px;
}#topicList
{
margin-top: 20px;
}
#topicList .topic
{
float: left;
width: 30%;
}#topicList .topic
{
float: left;
width: 30%;
padding: 10px;
text-align: center;
}#topicList .topic img
{
width: 90px;
}footer
{
padding: 20px;
margin-top: 20px;
color: #ffffff;
background-color: #FC5130;
text-align: center;
}<!DOCTYPE html>
<html>
<head>
<title>COM414 Internet Tech - About</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1><span class="highlight">Com414</span> Sample</h1>
</div>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li class="current"><a href="about.html">About</a></li>
<li><a href="products.html">Products</a></li>
</ul>
</nav>
</div>
</header>
<section id="news">
<div class="container">
<h1>Subscribe to the Newsletter</h1>
<form>
<input type="email" placeholder="e-mail address">
<button type="submit" class="button1">Subscribe</button>
</form>
</div>
</section>
<section id="main">
<div class="container">
</div>
</section>
<footer>
<p>Ulster University, Copyright © 2018</p>
</footer>
</body>
</html>...
<section id="main">
<div class="container">
<article id="main-article">
<h1 class="main-title">About Us</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer et ex est. Vivamus ex sapien, lacinia et condimentum vel, vestibulum id dui. Cras blandit consequat ligula sit amet venenatis. Suspendisse ullamcorper felis tellus. Nullam bibendum placerat dui. Etiam at venenatis turpis. Suspendisse eleifend vehicula urna vulputate auctor. Nam hendrerit elementum mauris hendrerit egestas. Nam dignissim, lorem eu efficitur gravida, nibh arcu commodo felis, at pretium nibh tortor nec augue. Maecenas eget euismod nulla. Quisque scelerisque metus ac arcu elementum varius. Vestibulum ut mi fermentum, sodales nunc pulvinar, tristique dui. Nullam fermentum malesuada nulla, vel fringilla eros lacinia ac. Integer ullamcorper dapibus dolor, sit amet lobortis nunc facilisis eget.</p>
<p>Aliquam pulvinar elit elit, vel porttitor ex sollicitudin a. Sed sagittis iaculis faucibus. Sed vel orci tempor, porttitor turpis eget, fringilla dui. Proin eu felis dolor. Pellentesque nec pretium tortor. Nunc a semper sapien. Vivamus vestibulum, nisi sit amet convallis vulputate, turpis dui ornare urna, eu placerat neque turpis ac nibh. Suspendisse egestas mollis dignissim.</p>
</article>
</div>
</section>
......
<section id="main">
<div class="container">
<article id="main-article">
<h1 class="main-title">About Us</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer et ex est. Vivamus ex sapien, lacinia et condimentum vel, vestibulum id dui. Cras blandit consequat ligula sit amet venenatis. Suspendisse ullamcorper felis tellus. Nullam bibendum placerat dui. Etiam at venenatis turpis. Suspendisse eleifend vehicula urna vulputate auctor. Nam hendrerit elementum mauris hendrerit egestas. Nam dignissim, lorem eu efficitur gravida, nibh arcu commodo felis, at pretium nibh tortor nec augue. Maecenas eget euismod nulla. Quisque scelerisque metus ac arcu elementum varius. Vestibulum ut mi fermentum, sodales nunc pulvinar, tristique dui. Nullam fermentum malesuada nulla, vel fringilla eros lacinia ac. Integer ullamcorper dapibus dolor, sit amet lobortis nunc facilisis eget.</p>
<p>Aliquam pulvinar elit elit, vel porttitor ex sollicitudin a. Sed sagittis iaculis faucibus. Sed vel orci tempor, porttitor turpis eget, fringilla dui. Proin eu felis dolor. Pellentesque nec pretium tortor. Nunc a semper sapien. Vivamus vestibulum, nisi sit amet convallis vulputate, turpis dui ornare urna, eu placerat neque turpis ac nibh. Suspendisse egestas mollis dignissim.</p>
</article>
<aside id="sidebar">
<h3>Teaching Aims</h3>
<p>Pellentesque nec pretium tortor. Nunc a semper sapien. Vivamus vestibulum, nisi sit amet convallis vulputate, turpis dui ornare urna, eu placerat neque turpis ac nibh. Suspendisse egestas mollis dignissim.</p>
</aside>
</div>
</section>
...aside#sidebar
{
float: right;
width: 30%;
margin-top: 10px;
}article#main-article
{
float:left;
width: 65%;
}.container
{
...
}
.coloredbox
{
padding: 15px;
background-color: #30BCED;
color: #FC5130;
margin-top: 10px;
margin-bottom: 10px;
}...
<aside id="sidebar">
<div class="coloredbox">
<h3>Teaching Aims</h3>
<p>Pellentesque nec pretium tortor. Nunc a semper sapien. Vivamus vestibulum, nisi sit amet convallis vulputate, turpis dui ornare urna, eu placerat neque turpis ac nibh. Suspendisse egestas mollis dignissim.</p>
</div>
</aside>
....container
{
...
}
.coloredbox
{
padding: 15px;
background-color: #30BCED;
color: #FC5130;
margin-top: 10px;
margin-bottom: 10px;
margin-right: 5px;
border: 1px solid #303036;
box-shadow: 2px 4px 8px black;
border-radius: 3px;
}<!DOCTYPE html>
<html>
<head>
<title>COM414 Internet Tech - Products</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1><span class="highlight">Com414</span> Sample</h1>
</div>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li class="current"><a href="products.html">Products</a></li>
</ul>
</nav>
</div>
</header>
<section id="news">
<div class="container">
<h1>Subscribe to the Newsletter</h1>
<form>
<input type="email" placeholder="e-mail address">
<button type="submit" class="button1">Subscribe</button>
</form>
</div>
</section>
<section id="main">
<div class="container">
<article id="main-article">
<h1 class="main-title">Products</h1>
</article>
<aside id="sidebar">
<div class="coloredbox">
<h3>Teaching Aims</h3>
<p>Pellentesque nec pretium tortor. Nunc a semper sapien. Vivamus vestibulum, nisi sit amet convallis vulputate, turpis dui ornare urna, eu placerat neque turpis ac nibh. Suspendisse egestas mollis dignissim.</p>
</div>
</aside>
</div>
</section>
<footer>
<p>Ulster University, Copyright © 2018</p>
</footer>
</body>
</html>...
<article id="main-article">
<h1 class="main-title">Products</h1>
<ul id="products">
<li>
<h3>HTML Basics</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam imperdiet suscipit nisl non varius.</p>
<p>Schedule: Weeks 1-3</p>
</li>
<li>
<h3>CSS Basics</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam imperdiet suscipit nisl non varius.</p>
<p>Schedule: Weeks 4-6</p>
</li>
<li>
<h3>Javascript Basics</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam imperdiet suscipit nisl non varius.</p>
<p>Schedule: Weeks 6-10</p>
</li>
</ul>
</article>
......
<aside id="sidebar">
<div class="coloredbox">
<h3>Ask a Question</h3>
<form class="question">
<div>
<label>Name</label><br>
<input type="text" placeholder="Name">
</div>
<div>
<label>Email</label><br>
<input type="email" placeholder="Email Address">
</div>
<div>
<label>Message</label><br>
<textarea placeholder="Message"></textarea>
</div>
<button class="button1" type="submit">Send</button>
</form>
</div>
</aside>
...ul#products
{
padding: 0;
}
ul#products li
{
list-style: none;
padding: 20px;
border: #303036 solid 1px;
margin-bottom: 5px;
background-color: #AFBFC0;
}aside#sidebar .question input, aside#sidebar .question textarea
{
width: 90%;
padding: 5px;
}@mediaThe @media rule is used in media queries to apply different styles for different media types/devices.
In other words, apply these extra styles for small screens to make them fit better on the screen
Main aim of making site like ours mobile friendly is removing the float left and right styles
We want elements stacked on top of each other
@media(max-width: 700px)
{
/*everything in here will only be affected
when screen is less that 700px wide*/
header #branding,
header nav,
header nav li
{
float: none;
text-align: center;
width: 100%;
}
}@media(max-width: 700px)
{
/*everything in here will only be affected
when screen is less that 700px wide*/
header #branding,
header nav,
header nav li
{
float: none;
text-align: center;
width: 100%;
}
header
{
padding-bottom: 20px;
}
}@media(max-width: 700px)
{
/*everything in here will only be affected
when screen is less that 700px wide*/
header #branding,
header nav,
header nav li
{
float: none;
text-align: center;
width: 100%;
}
header
{
padding-bottom: 20px;
}
#showcase h1
{
margin-top: 40px;
}
}@media(max-width: 700px)
{
/*everything in here will only be affected
when screen is less that 700px wide*/
header #branding,
header nav,
header nav li,
#news h1,
#news form
{
float: none;
text-align: center;
width: 100%;
}
header
{
padding-bottom: 20px;
}
#showcase h1
{
margin-top: 40px;
}
#news button
{
display: block;
width: 100%;
}
#news form input[type="email"]
{
width: 100%;
margin-bottom: 5px;
}
}@media(max-width: 700px)
{
/*everything in here will only be affected
when screen is less that 700px wide*/
header #branding,
header nav,
header nav li,
#news h1,
#news form,
#topicList .topic
{
float: none;
text-align: center;
width: 100%;
}
header
{
padding-bottom: 20px;
}
#showcase h1
{
margin-top: 40px;
}
#news button
{
display: block;
width: 100%;
}
#news form input[type="email"]
{
width: 100%;
margin-bottom: 5px;
}
}@media(max-width: 700px)
{
/*everything in here will only be affected
when screen is less that 700px wide*/
header #branding,
header nav,
header nav li,
#news h1,
#news form,
#topicList .topic,
article#main-article,
aside#sidebar
{
float: none;
text-align: center;
width: 100%;
}
{
float: none;
text-align: center;
width: 100%;
}
header
{
padding-bottom: 20px;
}
#showcase h1
{
margin-top: 40px;
}
#news button
{
display: block;
width: 100%;
}
#news form input[type="email"]
{
width: 100%;
margin-bottom: 5px;
}
}#news button, .question button
{
display: block;
width: 100%;
}@media(max-width: 700px)
{
/*everything in here will only be affected
when screen is less that 700px wide*/
header #branding,
header nav,
header nav li,
#news h1,
#news form
{
float: none;
text-align: center;
width: 100%;
}
header
{
padding-bottom: 20px;
}
#showcase h1
{
margin-top: 40px;
}
}