Consider this example: codepen
.infobox {
width: 110mm;
height: 65mm;
background-image: url(https://i.pinimg.com/564x/86/70/f2/8670f2ab34bf4082bf3cef004aae0826.jpg);
background-size: cover;
position: relative;
}
.text {
position: absolute;
bottom: 0;
text-align: center;
color: white;
}
<div class="infobox">
<span class="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel quam in enim pulvinar fringilla. Etiam molestie convallis pharetra. Sed et tortor tortor. Vestibulum ligula ex, rhoncus semper metus ut, hendrerit porttitor risus. Quisque at porta magna. Phasellus vel vulputate diam. Maecenas sem est, aliquet nec odio euismod, posuere luctus nisl. Vestibulum posuere iaculis massa, sed cursus dui pellentesque sed.</span>
</div>
I generate many of images and sometimes light text is ok, but in this case it is not.
What i tried was:
mix-blend-mode
- did not help
Sth like: filter: invert(1) grayscale(1) contrast(16) drop-shadow(.05em .05em orange);
Remember that it should work in many cases not only this one e.g. dark/light background. Can i manipulate color of text dynamicly?
Changing Text Background Color in CSS. To change the background color of inline text, go to the <head> section of your web page. Simply add the appropriate CSS selector and define the color and background-color property with the values you want. Say you want to change the background color of links to yellow.
Yes it is possible. Select the text you want "shaded" and then choose Format > Borders and Shading > Shading (tab). Make sure the "Apply To" list box says "Text" and then select your shading color and click Ok. Provides free AuthorTec add-ins for Mac & Win-Office.
This opens up the following Color and Appearance window (click to enlarge): As you can see Color and Appearance window allows you to choose colors of windows background, text, hyperlinked text, disabled text; and both foregrounds and backgrounds of selected text, active window titles, inactive window titles and buttons.
As you have checked the high contrast settings, it is set to off and the issue appears only in Word application, rest other Office applications are fine, please try the following suggestions and check if there’s any change. Open Word application in safe mode and then try selecting the text, check if background color of selected text is still black.
You may simply add a text-shadow
with a dark color and you will have a better rendring whataver the image you will use:
.infobox {
width: 110mm;
height: 65mm;
background:
linear-gradient(to bottom,transparent,#fff),
url(https://i.pinimg.com/564x/86/70/f2/8670f2ab34bf4082bf3cef004aae0826.jpg);
background-size: cover;
position: relative;
}
.text {
position: absolute; bottom: 0;
text-align: center; color: white;
text-shadow: -1px 0 1px #000,
1px 0 1px #000,
1px 1px 1px #000,
-1px -1px 1px #000,
0 1px 1px #000,
0 -1px 1px #000;
}
<div class="infobox">
<span class="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel quam in enim pulvinar fringilla. Etiam molestie convallis pharetra. Sed et tortor tortor. Vestibulum ligula ex, rhoncus semper metus ut, hendrerit porttitor risus. Quisque at porta magna. Phasellus vel vulputate diam. Maecenas sem est, aliquet nec odio euismod, posuere luctus nisl. Vestibulum posuere iaculis massa, sed cursus dui pellentesque sed.</span>
</div>
Another solution could be to make your image darker.
.infobox {
width: 110mm;
height: 65mm;
background-image:url(https://i.pinimg.com/564x/86/70/f2/8670f2ab34bf4082bf3cef004aae0826.jpg);
background-size: cover;
position: relative;
}
.infobox:before {
content: '';
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
background: rgba(0, 0, 0, 0.4);
}
.text {
position: absolute; bottom: 0;
text-align: center; color: white;
}
<div class="infobox">
<span class="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel quam in enim pulvinar fringilla. Etiam molestie convallis pharetra. Sed et tortor tortor. Vestibulum ligula ex, rhoncus semper metus ut, hendrerit porttitor risus. Quisque at porta magna. Phasellus vel vulputate diam. Maecenas sem est, aliquet nec odio euismod, posuere luctus nisl. Vestibulum posuere iaculis massa, sed cursus dui pellentesque sed.</span>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With