导航菜单
首页 >  dummy.png  > Placehold

Placehold

Documentation

How does it work exactly?

Size

The size can be specified using the format width x height:

https://placehold.co/600x400

Specifying the height is optional, useful for creating a square:

https://placehold.co/400

The maximum image size is 4000 x 4000 px.

The minimum image size is 10 x 10 px.

Format

The image format can be specified:

https://placehold.co/600x400/png https://placehold.co/600x400.png

The default format is SVG.

Image formats can also be combined with colours:

https://placehold.co/600x400/000000/FFFFFF/png https://placehold.co/600x400/000000/FFFFFF.png

Supported formats are SVG, PNG, JPEG, GIF and WebP.

Colour

The background and text colours are represented using hex values:

https://placehold.co/600x400/000000/FFF

Alternatively, CSS names can be used:

https://placehold.co/600x400/orange/white

Both background and text colours must be specified together.

Text

The text can be customised using a query string.

Spaces are represented using +:

https://placehold.co/600x400?text=Hello+World

New lines are represented using \n:

https://placehold.co/600x400?text=Hello\nWorld

The default text is the dimensions of the image.

Font

The font can be customised using a query string:

https://placehold.co/600x400?font=roboto

The following fonts can be used:

Lato Lora Montserrat Open Sans Oswald Playfair Display PT Sans Raleway Roboto Source Sans Pro

The default font is Lato.

Fonts can, of course, be combined with text:

https://placehold.co/800?text=Hello+World&font=roboto Retina

Need a retina image? Simply append @2x or @3x to the size:

https://placehold.co/600x400@2x.png https://placehold.co/800@2x.png https://placehold.co/600x400@3x.png https://placehold.co/800@3x.png

Only PNG, JPEG, GIF and WebP formats support retina images.

相关推荐: