Forums

Image in sidebar of original theme (2 posts)

  1. pjkuttner
    Member
    Posted 2 years ago #

    Hi all,

    I've put together an original theme, and I'd like to simply put an image in the sidebar inside a div. For some reason, which is probably obvious but i can't figure it out, the image won't show up. I can make it the background of the div, but not insert it with the img tag. Any suggestions would be very helpful. Below is the relevant code from the sidebar-right.php and style.css files.

    sidebar-right.php:

    <div class="sidebar-right">
    <div class="pic1">
    <img src="images/buttons/home.jpg" alt="nopic" />
    </div>
    </div>

    CSS:

    .sidebar-right{
    float:left;
    width:160px;
    height:100%;
    background-color:#999999;
    border:0;
    padding:0;
    margin: 0 0 0 10px;
    }

    .pic1 {
    width: 160px;
    height: 118px;
    margin-bottom: 10px;
    }

  2. Peter Boosten
    Member
    Posted 2 years ago #

    It's the path: as background, the image is relative to the directory your css resides in, but in html, it's relative to the webroot.

    Peter

Topic Closed

This topic has been closed to new replies.

About this Topic