Make a Wanted Poster (CSS properties)
This project introduces more CSS properties (text decoration, borders, margins, padding) that you can use to customize the
a e s t h e t i c
of your website! We'll use these CSS properties to create a "Wanted!" poster, like this one below for John Wilkes Booth and his conspirators.

-
Visit bit.ly/MakeAWantedPoster to open a starter project. Click the "Fork" button to make your own copy.
Note: the web preview next to the code editor may not work correctly. But the website will appear correctly when you open the webpage on a new tab by pressing thebutton on the top right of the page or by copying and pasting https://task-4-wantedposter--toniscullion1.repl.co (except, use your project name and your Replit username in the URL).
-
Open the
style.css
file. There are already some CSS properties set for the<div>
containing the different parts of the poster. -
Start by altering the property:
Try changing the wordtext-align: center;
center
toleft
orright
. Be sure to preserve the semicolon at the end of the line. -
How about the
border
property? In the code,2px
means 2 pixels. What happens when you change2px solid black
to4px dotted red
? Here are some different options that you can use for the border style:dashed dotted double groove inset outset ridge solid
-
Change the
width
to400px
. How do you like the look? Adjust the width until you're happy with the size. -
Let's add a new CSS property to set the poster's background color. Inside the div selector, add a new line:
Make sure you type the code exactly as it is above (with both colon and semicolon, all on its own line before the closing curly brace). The poster should change color!background: yellow;
You may need to visit the actual website by pressing thebutton or copying and pasting https://task-4-wantedposter--toniscullion1.repl.co (but with your project name and Replit username), if the live preview appears to be broken.
-
Add the following CSS property to your
div
selector:
What does this property do? What happens if you change the number in the code above?border-radius: 40px;
-
Let's now customize the styling for just the image, separate from the rest of the poster. Add the following code underneath
div
selector's CSS.
Then take a look at your poster. You should see that the robot gets a bit smaller, and a tight border appears around the robot.img { width: 100px; border: 1px solid black; }
-
The robot looks kind of cramped! We can fix this by adding some padding around the image. Add the following CSS property
to thepadding: 10px;
img
tag's CSS selector. Also, try changing the padding to50px
to see what happens. -
The "Wanted!" heading could use some more energy! Let's add some style to the
<h1>
tag. Add the following code:h1 { font-family: Impact; font-size: 50pt; }
-
There's a lot of space between the heading and the stuff around it. That space is called a margin. We can make the margin smaller using this CSS property:
Test it out.margin: 10px;
-
You can also underline your heading:
Here are some example options that you can use for text decoration:text-decoration: underline;
Try them out and see what you like.underline overline wavy underline double underline dotted underline dashed underline underline overline
-
Can you make your poster more awesome? You could . . .
- Add some style to the
<h3>
or<p>
tags, to further customize the poster. - Customize the text and image to make a "Wanted!" poster for a celebrity or friend, or perhaps re-create a historic poster.
- Instead of a "Wanted!" poster, you could make an advertisement for an event at Democracy Prep that you are involved in.
Below is a list of some CSS properties that you can use:
- Add some style to the
Credits: this lesson was adapted from both Toni Scullion's lesson plan and the corresponding Raspberry Pi Foundation project.