Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
May your rolls be merry + bright! 🎄
Create a free account

CSS and Body

Trying to figure out how to set a background image for my HTML but the CSS seems to be ignoring any body tags which means I also can't change the color. What am I missing here?
1431706810
Finderski
Plus
Sheet Author
Compendium Curator
What's your CSS look like? Does your body have a &lt;div&gt; tag as the main container? In your CSS you may want to .charsheet in front of your body tag as well. Something like this: .charsheet body { background-image: url("<a href="http://www.someurl.com/some-image.jpg" rel="nofollow">http://www.someurl.com/some-image.jpg</a>"); }
Doesn't work. I tried. Also .charsheet table.tableclass {css stuff} doesn't work. It's not reading classes anymore :| .charsheet body { background-image: url("<a href="http://visvalor.com/catbug.png" rel="nofollow">http://visvalor.com/catbug.png</a>"); }
1431708311
Finderski
Plus
Sheet Author
Compendium Curator
Can you post your html (or link to it) and your CSS? One thing to remember (because it's easy to forget) is that your class names in the CSS file need to start with .sheet- (and to keep things clean, I do that in my html, too).
Crap. Yep. Forgot sheet. Doesn't quite explain the image issue though. Why wouldn't this work? .charsheet body { background-color: #000000; }
1431710273
Finderski
Plus
Sheet Author
Compendium Curator
LOL - no worries...still happens to me from time to time. As for the other...Well, if there is an element, like a &lt;div&gt; tag that covers the entire body and it has a solid color for the background, it would hide the image in the &lt;body&gt;. I don't know if that's what is happening or not (without seeing the code). :)
Sent you a PM. Still trying to figure out how to add you to see the code stuff.
1431711202
Finderski
Plus
Sheet Author
Compendium Curator
Ok, I think I know the problem...the character sheet doesn't have a body tag of its own. You would want to change that to a div and give it a class of some sort. Then update your CSS to reflect that change. Does that make sense?
1431711673
Lithl
Pro
Sheet Author
API Scripter
There can only be one &lt;body&gt; tag in an HTML document. The entire VTT is one document. Trying to put a &lt;body&gt; tag in your character sheet produces invalid markup; the browser will more likely than not simply throw the tag out, making your CSS not match anything. If you simply want to put a background color or image over the entire sheet, using just .charsheet on its own as your selector should work fine.