1

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;
 }
pavel
27.3k11 gold badges47 silver badges63 bronze badges
asked Nov 16, 2014 at 8:05
1
  • check your image url Commented Nov 16, 2014 at 8:08

1 Answer 1

2

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");
 ^
answered Nov 16, 2014 at 8:08
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the help! I was able to resolve the issue.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.