Overview
Sources
Libraries
Images API

Text Padding text-padding

Specify a number of pixels to be added as padding to the rendered text.

Values

This parameter accepts integer values in the range 0 to 500 with 0 disabling text padding.

  • 1: add 1 pixel of padding to the rendered text.
  • 500: add 500 pixels of padding to the rendered text.

The default value for this parameter is 10, adding 10 pixels of padding.

text-padding sets the specified value to all edges of the rendered text. To set a value for one specific edge you can use the following parameters:

  • text-padding-top
  • text-padding-right
  • text-padding-bottom
  • text-padding-left

Examples

If no value is specified for text-padding a default value of 10 is used:

GET
https://assets.imglab-cdn.net/particles.jpeg
Rendering text over image with a padding of 10 pixels using text-padding parameter with a value of 10.
x px

It is possible to remove text padding using text-padding=0:

GET
https://assets.imglab-cdn.net/particles.jpeg?text-padding=0
Rendering text over image with disabled padding using text-padding parameter with a value of 0.
x px

For this example we are specifying a right text padding of 60 pixels with text-padding-right=60:

GET
https://assets.imglab-cdn.net/particles.jpeg?text-padding-right=60
Rendering text over image with a right padding of 60 pixels using text-padding-right parameter with a value of 60.
x px

In this example we are specifying a padding of 50 pixels with text-padding=50 parameter:

GET
https://assets.imglab-cdn.net/particles.jpeg?text-padding=50
Rendering text over image with a padding of 50 pixels using text-padding parameter with a value of 50.
x px

In this example we are specifying a padding of 100 pixels with text-padding=100 parameter:

GET
https://assets.imglab-cdn.net/particles.jpeg?text-padding=100
Rendering text over image with a padding of 100 pixels using text-padding parameter with a value of 100.
x px