• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Add Background Image To Widget Area Using CSS

This CSS enables you to add a background image to any widget area in any theme.

In this case the image has been uploaded to the WordPress Media Library however, you can also upload the image file to your child themes images folder and use this method :

.front-page-2 {
    background-image: url('https://wpsites.net/wp-content/uploads/2018/10/hero.jpg');
    background-color: #cccccc; 
    height: 500px; 
    background-position: center;
    background-repeat: no-repeat; 
    background-size: contain;
}

Assumes your main widget area class is front-page-2 otherwise swap that out to match your widgets container class.

CSS Installation #

Swap out the URL to your background image in the above CCS rule and paste at the end of your child themes functions file. Clear caching.

You can also upload a image to your child themes images folder and use this CSS declaration in replace of the full image link :

background-image: url('images/hero.jpg');

Use the following declaration to make the image cover the entire widget container :

background-size: cover;

To do this, change the value for the background-image from contain to cover.

Other Methods

  • Add a background image behind a widget area using inline CSS
  • Add Images To Front Page Widget Backgrounds

Background Image

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags