Web Design/CSS challenges
< Web Design
Web Design → CSS challenges
This page is part of the Web Design project.
These challenges are here to help you flex your CSS skills, and see where you need to practice more!
If you're new to CSS, you should go through the list of CSS properties from web4college. It represents the CSS tutorials from basic to advance with the examples related to every topic and an online code-editor is also available to practice these examples. Go ahead to the next level of CSS and learn new kind of web animations.

Challenge 1: Fonts and Colours
Challenge 1
This first challenge only involves changing your fonts and colours - no layout or other more advanced CSS here! Copy-n-paste the HTML to get started, and click on the image to see what your page should look like!
Hints:
<!DOCTYPE html><html> <head> <title>Challenge 1</title><link rel="stylesheet" href​=​"http://www.w3.org/Style/Examples/007/fonts"​/>​<​link href​=​"http://www.w3.org/Style/Examples/007/fonts" rel="stylesheet" /> <style>body{ background-color​:​black​; font-size: large; font-family: "roboto",sans-serif; margin:5%;}ul{ margin: 0 25%; display: inline-table;}footer{ font-size: small;}a:hover{ color: yellow​;​}​</​style​>​</​head​> <body style​=​"background-color:#9ab3f5"​> <h1>Shakespeare's Sonnet #18</h1> <p> This is one of the most famous of the sonnets. It is referenced in the film Dead Poets Society and gave names to the band The Darling Buds and the book and television series The Darling Buds of May. Read it and weep! </p> <ul> <li>Shall I compare thee to a summer's day?</li> <li>Thou art more lovely and more temperate:</li> <li>Rough winds do shake the darling buds of May,</li> <li>And summer's lease hath all too short a date:</li> <li>Sometime too hot the eye of heaven shines,</li> <li>And often is his gold complexion dimm'd,</li> <li>And every fair from fair sometime declines,</li> <li>By chance, or nature's changing course untrimm'd:</li> <li>But thy eternal summer shall not fade,</li> <li>Nor lose possession of that fair thou ow'st,</li> <li>Nor shall death brag thou wander'st in his shade,</li> <li>When in eternal lines to time thou grow'st,</li> <li>So long as men can breathe, or eyes can see,</li> <li>So long lives this, and this gives life to thee.</li> </ul> <p class​=​"copyright"​>​See the <a href​=​"http://en.wikipedia.org/wiki/Shakespeare%27s_Sonnets"​> Shakespeare's sonnets</a> Wikipedia article for more information </p> </body></html>
Challenge 2: Shakespeare's Sonnet
Challenge 2
Challenge 2-A
This second challenge will help you to re-cap your CSS text formatting skills, as well as start using margins and padding. Copy-n-paste the HTML to get started, and click on the image to see what your page should look like!
You can also try to get your page to look like the page from the image on the right (challenge 2-A), which uses a few more advanced (though not too hard) CSS techniques.
If you can improve on the design (shouldn't be too hard!) without increasing the difficulty of this challenge, great! I'll happily replace the image!
Hints:




<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "​http://www.w3.org/TR/html4/strict.dtd​">
<style> @import url('​https://fonts.googleapis.com/css2?family=Anton&display=swap'​); body{
background-color: burlywood;
margin-top: 5%; margin-left: 10%; margin-right: 10%; margin-bottom: 5%; }
wrap{
margin: auto; background-color: bisque; border: 4px dotted black;
} h1{
font-family: 'Anton', sans-serif; padding: 15px; font-size: 50px; text-align: center; width:50%; margin: 0 25%;
font-style: italic;} .line{ border-bottom: 4px dotted black; } ul{
padding: 10px; text-align: center; margin: 0 35%; display: inline-table; list-style: none; font-size: 18px; font-style: italic;
} .copyright{
padding: 10px;
} ul b{
font-size: x-large;
} p{
text-align: center; margin: 0 25%;
} </style>
<html>
<head> <title>CSS Challenge 2</title> </head> <body>
Shakespeare's Sonnet #18
This is one of the most famous of the sonnets. It is referenced in the film Dead Poets Society and gave names to the band The Darling Buds and the book and television series The Darling Buds of May. Read it and weep!
See the <a href="​http://en.wikipedia.org/wiki/Shakespeare%27s_Sonnets​"> Shakespeare's sonnets</a > Wikipedia article for more information
</body>
</html>
Challenge 3: 2-column layout
Challenge 3
This one will get you fiddling with margins and padding!
Hints:



<html> <head> <title>CSS Challenge 3</title> <link rel="stylesheet" href​=​"/vezba2/style.css"​> <style> body{ background-color: rgb(116, 116, 160); margin-top: 0%;margin-left: 25%;margin-right: 10%;margin-bottom: 5%;}#wrap{ height: 500px; display: flex; flex-wrap: wrap; }#nav{ background-color: rgb(171, 184, 245); padding: 10px;}#content{ background-color​:​rgb​(​134​, 134, 230); padding: 10px; width: 800px; text-align: center;}#content ul li{list-style: none​;​}​.​copyright​{​text-align​: justify; padding: 10px;} </style> </head> <body> <div id="wrap"> <div id="nav"> <h2>Sonnet Index</h2> <ul> <li><a href="#">Sonnet #1</a></li> <li><a href="#">Sonnet #6</a></li> <li><a href="#">Sonnet #11</a></li> <li><a href="#">Sonnet #15</a></li> <li><a href="#">Sonnet #18</a></li> </ul> </div> <div id="content"> <h1>Shakespeare's Sonnet #18</h1> <p>This is one of the most famous of the sonnets. It is referenced in the film Dead Poets Society and gave names to the band The Darling Buds and the book and television series The Darling Buds of May. Read it and weep!</p> <ul> <li>Shall I compare thee to a summer's day?</li> <li>Thou art more lovely and more temperate:</li> <li>Rough winds do shake the darling buds of May,</li> <li>And summer's lease hath all too short a date:</li> <li>Sometime too hot the eye of heaven shines,</li> <li>And often is his gold complexion dimm'd,</li> <li>And every fair from fair sometime declines,</li> <li>By chance, or nature's changing course untrimm'd:</li> <li>But thy eternal summer shall not fade,</li> <li>Nor lose possession of that fair thou ow'st,</li> <li>Nor shall death brag thou wander'st in his shade,</li> <li>When in eternal lines to time thou grow'st,</li> <li>So long as men can breathe, or eyes can see,</li> <li>So long lives this, and this gives life to thee.</li> </ul> </div> </div> <p class​=​"copyright"​>​See the <a href​=​"http://en.wikipedia.org/wiki/Shakespeare%27s_Sonnets"​> Shakespeare's sonnets</a> Wikipedia article for more information </p> </body></html>
Challenge 4: 2 Columns with a header and footer
Challenge 4
This time you've got an extra header and horizontal navigation to worry about!
Hints:



<html lang="en"> <head> <title>CSS Challenge 4</title> </head> <body> <div id="wrap"> <div id="header"> <​h1​>​Shakespear.net​</​h1​> </div> <div id="nav"> <ul> <li><a href​=​"#"​>​Home​</​a​></​li​> <li><a href​=​"#"​>​Writings​</​a​></​li​> <li><a href​=​"#"​>​Sonnets​</​a​></​li​> <li><a href="#">Life Story</a></li> <li><a href="#">About Shakespear.net​</​a​></​li​> </ul> </div> <div id="sidebar"> <h2>Sonnet Index</h2> <ul> <li><a href="#">Sonnet #1</a></li> <li><a href="#">Sonnet #6</a></li> <li><a href="#">Sonnet #11</a></li> <li><a href="#">Sonnet #15</a></li> <li><a href="#">Sonnet #18</a></li> </ul> </div> <div id="content"> <h1>Shakespeare's Sonnet #18</h1> <p>This is one of the most famous of the sonnets. It is referenced in the film Dead Poets Society and gave names to the band The Darling Buds and the book and television series The Darling Buds of May. Read it and weep!</p> <ul> <li>Shall I compare thee to a summer's day?</li> <li>Thou art more lovely and more temperate:</li> <li>Rough winds do shake the darling buds of May,</li> <li>And summer's lease hath all too short a date:</li> <li>Sometime too hot the eye of heaven shines,</li> <li>And often is his gold complexion dimm'd,</li> <li>And every fair from fair sometime declines,</li> <li>By chance, or nature's changing course untrimm'd:</li> <li>But thy eternal summer shall not fade,</li> <li>Nor lose possession of that fair thou ow'st,</li> <li>Nor shall death brag thou wander'st in his shade,</li> <li>When in eternal lines to time thou grow'st,</li> <li>So long as men can breathe, or eyes can see,</li> <li>So long lives this, and this gives life to thee.</li> </ul> </div> <div id="footer"> <p class​=​"copyright"​>​See the <a href​=​"http://en.wikipedia.org/wiki/Shakespeare%27s_Sonnets"​> Shakespeare's sonnets</a> Wikipedia article for more information </p> </div> </div> </body></html>
Challenge 5: Gimme some whitespace
Challenge 5
Logo for Challenge 5
This one's inspired by the design of clearleft. A nice clean look with lots of whitespace. Have fun!
Hints:
You'll need to hide the h1 somehow! (for some good tips on the best and most appropriate way to do this, you might like to read through WebAIM's Invisible Content page).



<!DOCTYPE html><html lang="en"> <head> <title>live and let learn</title> <meta http-equiv​=​"Content-Type" content="text/html; charset=utf-8"> </head> <body> <div id="header"> <blockquote> <p>Learning is not a privilege, it's a right.</p> </blockquote> <div id="logo"> <h1>live and let learn</h1> <img src​=​"csschallenge5.jpg" alt="live and let learn"> </div> </div> <div id="content"> <div id="content-side"> <dl> <dt><a href​=​"services/"​>​Services​</​a​></​dt​> <dd>Learning and facilitation through TAFE WSI</dd> <dt><a href​=​"learning/"​>​Personal Learning</a></dt> <dd>Learning from the network</dd> <dt><a href​=​"resources/"​>​Resources​</​a​></​dt​> <dd>Browse through resources ...</dd> <dt><a href​=​"about/"​>​About​</​a​></​dt​> <dd>What am I about? Personal interests and other stuff</dd> </dl> </div> <!-- content-side --> <div id="content-main"> <h2>Please update your links!</h2> <small>Wednesday, October 12th, 2005</small> <p>New blog address: <a href​=​"http://liveandletlearn.net/learning/"​> http://liveandletlearn.net/learning/​</​a​> </p> <p>During the last holidays I've been busy moving my blog from <a href​=​"http://www.absoludity.net/blog/"​>​absoludity.net​</​a​> to <a href​=​"http://liveandletlearn.net/learning/"​>​liveandletlearn.net​</​a​> ... why? Good question! Part of the Web Design course that I facilitate is a client project where participants are required to develop a site from start to finish - and i'd been a while since I'd been through that process myself - so what better a project for the holidays (next to my gardening project to get me <em>away</em> from the computer)! </p> <p>You'll notice that the site itself is still in prototype stage, but the blog is all up and running so I'm going to be using liveandletlearn from now on. <strong>Please update your bookmarks/feeds​</​strong​>​! And please give me any feedback you've got time for at <a href​=​"http://liveandletlearn.net/learning/"​>​liveandletlearn.net​</​a​>​! </p> </div> <!-- content-main --> </div> <!-- content --> </body></html>
Challenge 6: The Headline Challenge
This time you'll be working with a chunk of HTML similar to a blog post, but now you're in charge of the design. Create a colour scheme and layout that has a look and feel related to one of the following words:
Try using a background image that fits the aesthetic of your design, but remember to keep your text readable!
If you've started experimenting with CSS Web Fonts, this is a perfect place to use them. Font Squirrel and Google Web Fonts are excellent resources for finding decorative heading and body text fonts that are free to use.
For some inspiration, checkout the collection of Typography for Headlines
Hints:
<!DOCTYPE html><html lang="en"> <head> <title>Headline Challenge</title> </head> <body> <div id="wrap"> <div class="thepost"> <h1 class="posttitle">CSS Layout</h1> <h2 class​=​"dateheader"​>​Monday, May 29, 2006</h2> <p> Wonder when CSS layout techniques will be less of an art and more of a science. </p> <p class="postfooter"> <em>Posted by Robin.</em> </p> </div> </div> </body></html>
Challenge 7: Cutting the code
A small website design called Red Tie from OpenSource Web Design
This challenge is designed to help you build your process for producing a CSS-based layout from scratch. The idea is to choose a design from Open Source Web Design (or otherwise) that:
  1. you like!
  2. is a little beyond your current skills
  3. is not too far beyond your current skills (so you don't get overwhelmed!)
Without looking at the HTML/CSS of the chosen design, you'll then work together or on your own to code the HTML and CSS for the layout using the steps below.
This challenge is designed so that you can do it multiple times at different levels of difficulty if you find it helpful!
Steps:
If you get stuck, chat with the people around you to get ideas rather than looking at a solution. Only look at the solution if you're really really stuck and there's no one to talk with!
When you're happy with your design (and only then!), print out your HTML and CSS as well as the HTML and CSS that was used by the original author of your chosen design. Looking at the differences, work out the pro's and con's of your code versus the original.
Challenge 8: A CSS Zen Garden entry
The CSS Zen Garden site is a collection of unique designs that all use exactly the same HTML, with only the CSS changing between them. It's intended to show how powerful CSS can be in changing the site's style and appeal.
Your challenge is to create a simple CSS Zen Garden design. You'll find a link to the HTML and a simple starter CSS under the "Participation" heading on the front page. Download these files and work on your local computer to build something beautiful! If you're so inclined, you're welcome to contact the Zen Garden owners to get your design listed!
Challenge 9: CSSBattle targets
CSSBattle is an online code-golfing game where players have to visually replicate given targets using HTML/CSS. It's not only limited to code golfing but can also be used by developers starting to learn CSS to practice CSS properties.
There are plenty of targets there to practice your CSS skills there.

Last edited on 18 May 2021, at 04:34
Wikiversity
Content is available under CC BY-SA 3.0 unless otherwise noted.
Privacy policy
Terms of Use
Desktop
HomeRandomLog inSettingsDonateAbout WikiversityDisclaimers
WatchEdit