0

I would really appreciate it if someone can help me solve this weird problem that I have with expressionengine. Probably the problem is with the templates in particular, but I’m not sure.

The images that I have linked to the CSS are not showing on the page when I try to view a single template. I get images thumbnails instead. The CSS looks perfectly fine, but the images are not showing at all although I made sure that the link to the images folder on the server is correct.

Any idea what might be causing this problem?

  • 1
    It would be helpful to include relevant template code here. Also, make sure your server has access to read the images folder you are linking to. Try accessing the images directly using the address you know should work, and see if it does. – UltraBob Oct 1 '14 at 8:29
  • This is the code for one of the elements: <div class="header"> <img class="logo" src="images/uploads/logo-white.png"> </div> .header .logo { float: left; margin-left: 58px; margin-top: 70px; } I also would like to mention that when I view the website from the site link in the control panel, the images load perfectly fine and they all show up on the page, but when I click on another page or when I try to view the page from the templates section, then I get the problem. – user3282 Oct 1 '14 at 8:49
  • and this is the link to the style sheet: <link rel="stylesheet" type="text/css" media="all" href="{stylesheet='styles/main'}"/> – user3282 Oct 1 '14 at 8:56
0

"The CSS looks perfectly fine".

But it isn't. If it was then the images would load. EE won't have any influence over whether the images load or not.

It is most likely a problem with how the image path is referenced from the page you are viewing. Are you using relative or absolute URLs? I find it helpful to create all image paths relative to the site root rather than the url being viewed.

So instead of perhaps "../../images/myimage.jpg" I would use "/images/myimage.jpg". Then it doesn't matter where in the site you are, you will always have a correct path.

You need to include template code, your css, and ideally a link to a page where the images aren't loading. Otherwise this is all guesswork.

| improve this answer | |
  • This is the code for one of the elements: <div class="header"> <img class="logo" src="images/uploads/logo-white.png"> </div> .header .logo { float: left; margin-left: 58px; margin-top: 70px; } I also would like to mention that when I view the website from the site link in the control panel, the images load perfectly fine and they all show up on the page, but when I click on another page or when I try to view the page from the templates section, then I get the problem. – user3282 Oct 1 '14 at 8:50
  • and this is the link to the style sheet: <link rel="stylesheet" type="text/css" media="all" href="{stylesheet='styles/main'}"/> – user3282 Oct 1 '14 at 8:57
  • add a / before "images" in your image url. – foamcow Oct 1 '14 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.