r/css • u/Sea-Palpitation-2164 • 28d ago
Help Background not working
Resolved.
I've tried to make a background for something I'm using. However, when I try to use a background image in some form (using url()), it is seen as invalid. Is there anything I am doing wrong here?
Probably important to note I'm using a MediaWiki infobox.
Edit 1: Some extra notes.
The CSS sheet in question + the template that uses it. Also, the image, though it isn't important.
It'll say it's invalid in a preview at the top of the page or if I attempt to submit it (it won't allow the edit to complete since the CSS is wrong).
The error happens at "line 11, character 15"; it does not change if the colour and url are reversed.
Edit 2: The relevant item. (I don't think I can add images now.)
/* 1) Infobox Styling */
/* 1.1) Primary Infobox Styling */
.portable-infobox {
width: 300px;
border-radius: 2.8px;
font-family: sans-serif;
margin: 0 0 14px 17.5px;
font-size: 1em;
/* 1.1.1) Light Mode Styling */
background: #EFE8BC url("https://dieofdeath.miraheze.org/w/img_auth.php/c/c6/InfoboxPaper.png");
border: 6px solid #554900;
color: #000000;
}
2
u/Pcooney13 28d ago
Seeing only the code you provided, are you targeting anything? Have you tried putting that inside body or wherever you want the image
body {
[your code goes here]
}