Help > Layout & Coding Help > Post Reply     

How to put a solid color behind the text on my page?

Default Avatar
Turner
April 8th, 2015 12:40:27am
6 Posts

I recently added a background to my page. I am wondering how I can put a white box around the center of the page, so that you can actually read the text? I used to do coding and am usually pretty good at figuring things out, but it's hard to google help for horse phenomena specifically.


Basically I just want the center of the page to have a white background, but the pattern should be on the sides and a little on the top and bottom of the page.




 


View Comments 1


Player Avatar
trig 🎄 jingle all the way
April 8th, 2015 1:14:57am
3,614 Posts

inbetween the style tags where you've added your background, you'll need to add another piece of coding for the "content" part. You can type out actual colors or use hex codes. So if you wanted it to be white you can simply type "white" or the hex code is "#FFFFFF" 

content {background-color: white;}




Bailey Lucky Diesel Mixed Berries rooster-icon-2-orig_orig.png

 

Default Avatar
Turner
April 8th, 2015 11:18:29am
6 Posts

Thanks for the reply. This is what I have so far, and it's not fixing the problem. Am I doing something wrong? The background image is working though.

 

body {

    background-image: url("http://i59.tinypic.com/2n8v685.png");  

}

content {

    background-color:#FFFFFF;

}




 

Default Avatar
Insomnia • [74] ⸸ Spare
April 8th, 2015 1:54:03pm
10 Posts

Instead of having the background image under the body tag, put it under an html tag

 

html {

background-image: url("http://i59.tinypic.com/2n8v685.png"); }

 

and then have your body tag be the solid color background

 

body {

background-color: #ffffff;}




 

Default Avatar
Turner
April 8th, 2015 11:34:21pm
6 Posts

That worked! Thanks!

 

One other question: is there a way to make the white color semi-transparent? I can lower the body opacity but it lowers the opacity of all of the text as well.




 

Player Avatar
DOUNIA | Al Kabir Arabians
April 9th, 2015 12:48:46am
961 Posts

For your body tag use an rgba instead of a hex code:

body {

background-color:rgba(255, 255, 255, 0.5);}

 

The 0.5 adjusts the opacity of the color specified in the three digit RGB code!




[censored] will be free

 

Default Avatar
Turner
April 9th, 2015 10:50:04am
6 Posts

Awesome! Thank you all so much.




 

View Comments 1