Mike
Mike

Reputation: 21

CSS Background image Issues

I am trying to get an image to display an image using css background image, but I am not able to get the image to render.

HTML:

<div class="row">
<div class="col-lg-12">
    <div class="row" class="rmh-logo">
        <div class="col-lg-9" align="left">
            <h1><?php echo "{$pageHeading}"; ?></h1>
        </div>
        **<div class="col-lg-3" align="right" class="rmh-logo">
            <!--<img src ="/rmhcOmahaTeam/assets/img/logo.png" width ="200" height ="100">   -->
        </div>**
    </div>
    <ol class="breadcrumb">
        <li>
            <?php echo "{$navLinks}"; ?>
        </li>
    </ol>
  </div>
  </div>'

CSS:

.rmh-logo {
    background-image: url("rmhOmahaTeam/assets/img/logo.png");
    background-repeat: no-repeat;
    background-position: top right;
    width:200px;
    height:100px;
 }

Upvotes: 1

Views: 173

Answers (1)

pavel
pavel

Reputation: 27072

In HTML you have a slash linking to the root /rmhOmahaTeam/assets/img/logo.png, in CSS not.

I expected your CSS file is in any directory and not in the website root.

background-image: url("/rmhOmahaTeam/assets/img/logo.png");
                       ^

Upvotes: 2

Related Questions