TheoretiCAL
TheoretiCAL

Reputation: 20571

Changing font color without using color style

I'm currently using a content management system that is automatically stripping any style="color:white;" inline css, but I need to change the font color of a certain element to white. Is there any trick I can use that can make it appear as if the font is white, without using color:white? (note the white here could have been #fff, rgb(0,0,0) ect)

Note:

I cannot define a css class because <style> tags are deleted completely, and any inline color definition is changed to "color: ;". I was hoping for a solution where I can use something like webkit stroke to make something with black font appear white, or something tricky like that

Upvotes: 2

Views: 1080

Answers (2)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201678

If the CMS actually removes a style attribute (though this may be a misinterpretation), then set class=white on the element and add the following CSS code to an external style sheet being used or in a style element:

.white { color: white }

If this is not possible, then use font markup, e.g. instead of <span style="color:white;">foo</span> use

<span color=white>foo</font>

Upvotes: 0

mswieboda
mswieboda

Reputation: 1036

color: #ffffff; is the hex of white, also if they check against that try color: rgb(0, 0, 0); or rgba(0,0,0,1);

or better yet use CSS classes:

HTML

<div class="white"></div>

CSS

.white {
  color: #ffffff;
}

Upvotes: 3

Related Questions