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

DPO Kasus Narkoba Ditangkap, Polsek Ujung Batu Amankan 6 Paket Sabu dan Uang Tunai Rp900 Ribu

11:57:30 WIB

  • Hukum/Kriminal
2

PAC Pemuda Pancasila Kepenuhan Mulai Bergerak, Nopri Aris Pimpin Karateker

17:35:40 WIB

  • Daerah
3

Fredy Feronico Resmi Jabat Kajari Rohul, ESI Rohul Sambut dengan Dukungan dan Harapan Baru

13:10:01 WIB

  • Daerah
4

Perkuat Ketertiban, Lapas Pasir Pangarayan Gelar Sambung Rasa Bersama Warga Binaan

12:24:23 WIB

  • Daerah
5

Bupati dan Wakil Bupati Ikuti Launching Buku Panduan Pendidikan Antikorupsi dan Rakor Inflasi

09:12:15 WIB

  • Pendidikan
6

Perangi Narkoba, KNPI Rokan Hulu Siap Bersinergi dengan Pemda dan Polres

09:16:09 WIB

  • Daerah
7

Bupati Zukri hadiri Rakortekbang Tahun 2026, dan RKPD 2027

09:07:01 WIB

  • Sosial
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