SourceCode
  • Index All
  • Karir
  • pendidikan
  • Home

Home >> CSS

CSS background-image Property

Author SCode

Selasa, 25 Oktober 2022 - 10:30:03 WIB

CSS background-image Property

Manual Book CSS background-image Property

Set a background-image for theelement:


body {



  background-color: yellow;   //used black or cccccc />  background-image: url("background.gif");
}


Set two background images for theelement:


body {
  background-image: url("background1.gif"), url("bacground2.gif");
  background-color: dddddd; //used black or cccccc />
}


Sets two background images for theelement. Let the first image appear only once (with no-repeat), and let the second image be repeated:


body {
  
background-repeat: repeat, no-repeat;


  background-image: url("img1.gif"), url("img2.gif");
  background-color: 333333; />
}


Use different background properties to create a "hero" image:


.hero-image {
  background-image: url("image1.jpg"); /* The image used */
  background-color: 444444;  class="commentcolor">/* Used if the image is unavailable */

  height: 600px; /* You must set a specified height */
 
background-repeat: no-repeat; /* Do not repeat the image */


  background-size: cover; /* Resize the background image to cover the entire container */


  background-position: center; /* Center,left ,right the image */
 
}


Sets a linear-gradient (two colors) as a background image for a


element:

#grad1 {
  height: 300px;
  background-color: 444444; />  background-image: linear-gradient(blue, red);
}


Sets a linear-gradient (three colors) as a background image for a


element:

#grad1 {
  height: 100px;
  background-color: 33333333; />  background-image: linear-gradient(green, red, yellow);
}


The repeating-linear-gradient() function is used to repeat linear gradients:


#grad1 {
  height: 100px;
  background-color: dddddd;
  background-image: repeating-linear-gradient(blue, yellow 20%, green 10%);
}


Sets a radial-gradient (two colors) as a background image for a


element:

#grad1 {
  height: 300px;
  background-color: 333333; />  background-image: radial-gradient(blue, yellow);
}


Sets a radial-gradient (three colors) as a background image for a


element:

#gradient1 {
  height: 300px;
  background-color: 333333; />  background-image: radial-gradient(green, yellow, blue);
}


The repeating-radial-gradient() function is used to repeat radial gradients:


#grad1 {
  height: 150px;
  background-color: 333333; />  background-image: repeating-radial-gradient(blue, brown 20%, green 10%);
}

Editor :SCode

Source : https://www.w3schools.com/

NP

Send to your Friends !

Populer

1

HUT ke-69 Riau, Plt Bupati Kuansing H. Muklisin Dorong Penguatan Sinergi Pembangunan

10:02:55 WIB

  • Sosial
2

Bupati Rohul Anton Hadiri HUT ke-69 Riau, Terima Piagam Penghargaan dari Gubernur SF Hariyanto

08:36:41 WIB

  • Pemerintah
3

Pemuda Pancasila Soroti Kinerja Anton-Poti: Setahun Lebih Memimpin, Rohul Dinilai Mulai Berubah

09:58:24 WIB

  • Daerah
4

Pangdam XIX Tuanku Tambusai Saksikan Ketamin 1,3 Ton Dibakar, Hasil Penggagalan MV King Sun

06:39:28 WIB

  • Hukum dan Kriminal
5

Ekspedisi Merah Putih Presisi Jangkau Pelosok Rokan Hulu, Wujud Negara Hadir di Wilayah 3T

22:51:40 WIB

  • Pemerintah
6

Lapas Kelas IIB Pasir Pangarayan Gelar Pemeriksaan Kesehatan Gratis bagi Pegawai dan Warga Binaan

15:46:51 WIB

  • Kesehatan
7

Semarak HUT ke-81 RI, Kecamatan Kepenuhan Hulu Gelar Pawai Jalan Sehat

19:52:40 WIB

  • Wisata
BACK TO TOP

Redaksi

SourceCode

Penanggung Jawab : Pimpinan Redaksi Utama

Redaksi

Member Of
Jaringan Informasi
seedbacklink
  • Kode Etik Internal
  • KEJ
  • Disclaimer
  • Tentang Kami
  • Pedoman Media Siber
  • Redaksi
  • Facebook
  • Twitter
  • Sitemap
  • RSS

© 2020 Jaringan Informasi. All rights reserved.

×
×

M E N U

SourceCode
  • Home

N E T W O R K

  • jawabarat
  • Guide
  • Money
  • Liputan
  • Real
  • Gadget Guide
  • Cat Food
  • Lifestyle
  • Review Pinjol
  • SourceCode
  • Otomotif
  • infotorial
  • Tutor
  • Theme
  • Sains
  • Finance
  • Entertain
  • Edukasi
  • InfoTerbaru
  • Traveling
  • Sport
  • TeknoPedia
  • Blog
  • Techno Guide
  • Automotive Guide
  • Trending
  • Smartphone Guide
  • EduBudaya
  • EduStyle
  • TeknoGame
  • Economy
  • Tekno
  • Recipes
  • Loker
  • InfoKepri
  • KuansingTerkini
  • Bisnis
  • Sehat
  • PotensiRohil
  • LabuhanBatu
  • Info Rohul
  • Nusapos
  • Karir
  • pendidikan
  • Kode Etik Internal
  • KEJ
  • Disclaimer
  • Tentang Kami
  • Pedoman Media Siber
  • Redaksi
  • Index All