Polka Dot Background Pattern
index.html
and style.css
have already been provided in the VM.
To create a polka dot background pattern, you can follow these steps:
- Set the
background-color
property to black.
- Use the
background-image
property with two radial-gradient()
values to create two dots.
- Specify the pattern's size using the
background-size
property. Use background-position
to appropriately place the two gradients.
- Set
background-repeat
to repeat
.
- Note that the fixed
height
and width
of the element is for demonstration purposes only.
Here's an example HTML code for a div element with class polka-dot
:
<div class="polka-dot"></div>
And here's the corresponding CSS code:
.polka-dot {
width: 240px;
height: 240px;
background-color: #000;
background-image: radial-gradient(#fff 10%, transparent 11%),
radial-gradient(#fff 10%, transparent 11%);
background-size: 60px 60px;
background-position:
0 0,
30px 30px;
background-repeat: repeat;
}
Please click on 'Go Live' in the bottom right corner to run the web service on port 8080. Then, you can refresh the Web 8080 Tab to preview the web page.