Day # 11: Background Pattern
Backgrounds are a very important element of a website’s appearance. Depending on your client’s needs, you may need to come up with a more original background. Being able to create an innovative background for your website can make the difference between a fresh design and a rather classic one. In order to accomplish this, I decided to look over the “background-image” property, which allows us to create patterns and repeat them all over the website. In addition to that, you can also use the linear gradient to come up with color gradations that will add a sophisticated touch to your background design. background-image:
linear-gradient(45deg, rgba(38, 0, 255, 0.5) 50%, transparent 50%),
linear-gradient(-45deg, transparent 50%, rgba(38, 0, 255, 0.5) 50%); As an added bonus, I have included a couple of buttons to choose between having a bigger or smaller pattern, by setting the background-size property using Javascript: bigger.addEventListener("click", function() {
body.style.backgroundSize = "100px 100px"
})
smaller.addEventListener("click", function() {
body.style.backgroundSize = "30px 30px"
}) It is often tempting to always use the typical backgrounds for your website, but you could also make an effort to think and implement new ways for your website to look fresh, by just using a couple of CSS lines!
Comments
Post a Comment