WordPress.org

Ready to get started?Download WordPress

Forums

Changing the background to an image (2 posts)

  1. helenaz
    Member
    Posted 5 years ago #

    Hi

    Is it possible to use an image as a background?

    If so, how do I do that?

    Have tried to put my image url in but it doesn't work.

  2. stvwlf
    Member
    Posted 5 years ago #

    Yes, its done all the time. If you are adding the code into the stylesheet, the URL is relative to the stylesheet. Translation: put it in the images folder that is within your theme's folder

    background-image: url(images/myimage.jpg) no-repeat;

    if you add it into header.php the url has to be the full path
    #mydiv { background-image: url(<?php bloginfo('template_directory'); ?>/images/myimage.jpg) no-repeat; }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags