Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background-aware text color

I have a responsive site that has a dynamically sized background image that has some dark and light areas. In browser the font colors are tuned to have nice contrast over the color of the background image.

Unfortunately in the responsive (mobile) design some text is layered over darker parts of the re-sized background image and the text can be very difficult to read. Does anyone know of a jQuery plugin or technique where the text can be made aware of the background behind it and change style/color accordingly?

like image 512
d-coded Avatar asked Jun 04 '13 19:06

d-coded


People also ask

What is the best background Colour for reading text?

Black text on a white background provides maximal value contrast and, therefore, optimal readability for body text. Black text on a white background provides maximal value contrast and, therefore, optimal readability for body text.

What is background Colour and text Colour?

Definition and UsageThe background-color property sets the background color of an element. The background of an element is the total size of the element, including padding and border (but not the margin). Tip: Use a background color and a text color that makes the text easy to read.

What color text is best for green background?

Colors that Go with Green: Brown and White Given that the background has darker colors, white comes in handy to create contrast. It's also in line with the naturalness of the view, while focusing attention onto title and call-to-action.


1 Answers

you can use text-shadow to mark the edge of your text.

body {
/* your rules */
color: rgba(0 , 0, 0, 0.8 ); /* just a guess that it might be black;*/
text-shadow: 
    0 0 1px gold, 
    0 0 3px white; /* choose how many and which colors */
}

That is the idea

like image 92
G-Cyrillus Avatar answered Oct 22 '22 13:10

G-Cyrillus