Comment Box Pictures
This page contains examples of comment boxes with background pictures. Feel free to copy and paste the code for your own use.
Adding a Background Picture
In this example, I've added a background image to my comment box. This is done by using the background
property.
You can easily resize the comment box to fit your picture - just look for the width
and height
properties in the code and set them to be the same (or smaller) to the image size.
Alternatively, you can use the background-size
property to specify the size of the background image. More on this below.
Non-Repeating Background Image
You can use the background-repeat
property to specify whether the image should repeat or not.
Here, we specify no-repeat
so that the image appears once only. We also use background-position
to position the image in the center of the comment box.
Background Size
You can use the background-size
property to specify the size of your background image.
Here, I use background-size: cover
to specify that the image should be scaled, while preserving its intrinsic aspect ratio (if any), to the smallest size such that both its width and its height can fit inside the background positioning area.
Text Color
Depending on your background image, you might need to change the color and/or size of the text so that it's readable (as I did in the above example).
To change the text color, use the color
property.