Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Broken image but works fine in CSSBroken image but works fine in CSS
Previous
 
Next
New Post
5/8/2012 9:44 AM
 

Hi all,

This should be so simple yet I can't figure it out.

I have the following html img tag in my skin file:

<img src="images/search2.gif">

It won't show the image when I view the page that uses the skin.  I see the "x", or broken image symbol on the page.  However, if I add a div tag and set the background using the exact same path to the image, it works fine.  Here's the div:

<div class="btn"></div>

And here's the CSS for it:

 .btn{
 width: 25px;
 height: 25px;
 background: url(images/search2.gif) no-repeat; 
}

Both the skin file and css file are in the root of the skin folder and underneath is an "images" folder with all my images.  The path to the image should be the same regardless of whether I'm using CSS or an img tag yet the hmg tag won't display the image.  I even tried to navigate to the image using the path selector in Visual Studio with no luck and also tried an image in another skin folder.  Nothing. 

Can someone please explain to me why one method works yet the other doesn't?

Thanks,

Mark

 
New Post
5/8/2012 9:58 AM
 
the html will be referenced relative to the URL for the page, not where the skin is.

There is a standard magic recipe for this, somthing like <%= SkinPath %>/images...

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
5/8/2012 10:49 AM
 
Richard,

Thanks. I knew I was missing something within DNN because it was too easy to mess up otherwise.

Regards,
Mark
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Broken image but works fine in CSSBroken image but works fine in CSS


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out