Dhruv Dhruv - 5 months ago 11
CSS Question

How to set a width of the background (HTML and CSS)

So I want to make the gradient in the background of my webpage to not keep going and have a width. I am not sure how to do this and I tried in the css but it didn't work.

My HTML

My Css

I'm sorry that my css it is a bit blurry but I had to fit it in one screenshot.

Answer

This should be the code.

body { /*or whatever element*/
    background-size:#px #px; /*replace size for #'s*/
    background-repeat: no-repeat;
}
Comments