HomeHomeUsing DotNetNuk...Using DotNetNuk...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 DotNetNuk...Using DotNetNuk...Skins, Themes, ...Skins, Themes, ...Broken image but works fine in CSSBroken image but works fine in CSS


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Attend A Webinar
Start  Professional Edition Trial
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Sponsors

DotNetNuke Corporation

DotNetNuke (DNN) provides a suite of solutions that make designing, building and managing feature-rich sites and communities fast, easy and cost-effective. The DotNetNuke Platform CMS is the foundation for more than one million websites worldwide. DNN Social, our newest solution, enables businesses to create immersive, interactive communities. Thousands of organizations like True Value Hardware, Bose, Cornell University, Glacier Water, Dannon, Delphi, USAA, NASCAR, Northern Health and the City of Denver have leveraged DNN to deploy highly engaging business- critical websites. Our rapid growth in product sales and deployments resulted in DotNetNuke Corp. being named one of the fastest growing private companies in America by Inc. Magazine in 2011 and 2012.