#How do I color and format this square for an infobox?

1 messages · Page 1 of 1 (latest)

fickle beacon
#

The best way to get a CSS answer is (if possible) to provide a link to the page. It's because folks generally need to see and inspect the full html code and know what you're putting where. There could be other CSS overriding what you want, and stored in places other than the code provided.

#

I can't immediately tell how your template is adding the "Yes" class to anything, and your css seems to depend on that class.

#

I don't think it is applied anywhere.

#

I'd probably do something like this...

#

a new class called "dicounted-{{{discntd|}}}", so when the value is "Yes" you can target the style .dicounted-Yes directly.

#

Just know that case matters in CSS.

#

(I used miraheze global user directory to find your username/site).

#

The following style also overrides the color:

  color: black;
}```
fickle beacon
# fickle beacon

As black is the default color, you shouldn't need to specify black, I'd think. Once I removed that, my version here worked.

#

You can use the MediaWiki magic word {{ucfirst:}} to convert the first character to a capital, regardless of what was entered. That way, "yes" or "Yes" will work, since "yes" will get converted to "Yes".

<td class="discounted-ask discounted-{{ucfirst:{{{discntd|}}}}}">{{{discntd|}}}</td>

#

Since relying on users to type things the way you want is always sketchy at best. 😆

odd fossil
#

Hello, @fickle beacon . Didn't noticed that my thread was getting messages until today. Sorry for not giving link the moment I created the post; I was waiting to get e response to send links. Also, was expecting that giving the wiki code and the css would be enough. I'm checking everything right now.

odd fossil
odd fossil
#

Also, been checking the template you created, at first instance I was unable to detect the changes, but finally, spotted them.

odd fossil
#

should I delete this?