url in css code example

Example 1: css background image

background-image: url("image.png");
background-position: center;
background-repeat: no-repeat;
background-size: cover;

Example 2: how to add image with url in css

background-image: url('images/my-image.png');

Example 3: url css

/* Import a style sheet */
@import url("https://www.example.com/style.css");

/* Import a font */
@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap");
font-family: 'Roboto', sans-serif;

/* Use an image in background */
background: url("https://mdn.mozillademos.org/files/16761/star.gif") bottom right repeat-x blue;

Tags:

Css Example