in reply to CGI and CSS

To diagnose your immediate problem, use a debugger on your browser to enable you to see exactly what HTML the browser received and exactly what the browser did in response to it.   Also examine the web server’s access and/or error logs.   Generally speaking, content such as CSS and images should be static, served-up directly by the web server without directly involving your program, so the correct operation of the site will depend both upon your Perl programming and the web server configuration for this particular URL.

Meanwhile, to avoid burying yourself completely in an unmarked grave of Maintenance Hell™, rewrite this program (a) to use an existing web site framework, and (b) learn how to use templates to separate the HTML presentation of your site from the logic which drives it.   A program with a design such as the one you are starting to construct here, will become a noose around your neck in no time at all.

Replies are listed 'Best First'.
Re^2: CGI and CSS
by AdrianJ217 (Novice) on Mar 04, 2014 at 17:18 UTC

    Thank you. I'm using chrome so I went to the Tools section and then Development Tools and it says "Failed to load resource: the server responded with a status of 404 (Not Found)". This shows up twice and underneath one is the website for the CSS file and the other is for the image, and both are the correct website. I even typed it into the address bar and it gets me to those files. I just don't understand why it's not displaying the image correctly once the cgi is called.

      "I just don't understand why it's not displaying the image correctly"

      Clearly the path is not correct in relation to where this file is being served from. If the webserver says 404, the file you're looking for isn't available at the location you have requested. Had you changed the src/href to be the full http address to the file (which you say works) you could see your page working. If you want to make life easy for yourself error logs, debugging ....

      Take the time to learn the basics of the tools you have chosen to work with, Tutorials->CGI Programming->Ovid's CGI Course. Returning invalid HTML is also a sure fire way to confuse matters.