Taking your web development skills to the next level
Semantic elements clearly describe their meaning to both the browser and the developer.
<div>
, <span>
<form>
, <table>
, <article>
Identify one non-semantic element in your HTML and suggest a semantic alternative.
<section>
<article>
<header>
<footer>
<main>
<nav>
<aside>
<header>
<h1>My Website</h1>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
</ul>
</nav>
</header>
<main>
<article>
<h2>Article Title</h2>
<p>Article content...</p>
</article>
<aside>
<h3>Related Links</h3>
<ul>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
</ul>
</aside>
</main>
<footer>
<p>© 2024 My Website</p>
</footer>
List three semantic elements you would use to structure a simple blog post.
Used for displaying tabular data with rows and columns.
<table>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1, Cell 1</td>
<td>Row 1, Cell 2</td>
</tr>
<tr>
<td>Row 2, Cell 1</td>
<td>Row 2, Cell 2</td>
</tr>
</tbody>
</table>
Create a simple HTML table with 2 columns and 3 rows, including a header row.
Used to collect user input.
<form action="/submit" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<button type="submit">Submit</button>
</form>
<input type="text" name="username">
<input type="password" name="password">
<input type="email" name="email">
<input type="checkbox" name="subscribe">
<input type="radio" name="gender" value="male"> Male
<input type="radio" name="gender" value="female"> Female
<input type="submit" value="Submit">
Create a simple contact form with fields for name, email, and a message.
<!-- Checkboxes -->
<input type="checkbox" id="option1" name="option1" value="1">
<label for="option1">Option 1</label>
<input type="checkbox" id="option2" name="option2" value="2">
<label for="option2">Option 2</label>
<!-- Dropdown -->
<select name="cars" id="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
A layout model that provides an easy and clean way to arrange items within a container.
.container {
display: flex;
justify-content: space-between;
align-items: center;
}
.item {
flex: 1;
}
Use Flexbox to create a simple horizontal navigation bar with three items.
A two-dimensional layout system for the web.
.container {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.item {
grid-column: span 2;
}
Create a simple 2x2 grid layout using CSS Grid.
.button {
transition: background-color 0.3s ease;
}
.button:hover {
background-color: #ff0000;
}
Add a simple color transition to a button on hover.
@keyframes slide-in {
from { transform: translateX(-100%); }
to { transform: translateX(0); }
}
.animated-element {
animation: slide-in 0.5s forwards;
}
Create a simple fade-in animation for a heading element.
Extends CSS with features like variables, nesting, and mixins.
$primary-color: #3498db;
.button {
background-color: $primary-color;
&:hover {
background-color: darken($primary-color, 10%);
}
}
Define a Sass variable for a primary color and use it in a button style.
Creating web pages that look good on all devices.
@media screen and (max-width: 600px) {
.column {
width: 100%;
}
}
Write a media query that changes the font size of a heading when the screen width is less than 480px.
Any questions?
Continue your web development journey!
Next Back to Home