PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, February 17, 2022

[FIXED] Images in CSS not displaying when run through MAMP localhost

 February 17, 2022     codeigniter, css, mamp, web     No comments   

Issue

Just started building a website and its my first time using MAMP and CodeIgniter Framework. I am trying to get images from the CSS code to display but they are not showing up when I open the website in the localhost. My question is:

Do I need to put the images in a specific location in MAMP's docs? or is there something I am not configuring first?...(I bet its something tiny I have not done..) Just to note I have tried changing the URL and file location a few times but had no luck..

Here is the CSS code which links to the image I am trying to display, everything else works except the images are not displaying.

Please help.

#header {
overflow: hidden;
width: 1000px;
height: 50px;
margin: 00px auto 20px auto;
background: url(/Applications/MAMP/htdocs/website/application/views/images/img03.jpg) no-repeat right top;
}

Solution

background: url(/Applications/MAMP/htdocs/website/application/views/images/img03.jpg)

"localhost" points to htdocs, you must set starting the route from there

background: url(/website/application/views/images/img03.jpg)

can use with F12 if you use chrome if the correct path to the image



Answered By - John Paul Cárdenas
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing