I was reading, "Use CSS Images instead of IMG tag: An easy way to..
-
speed up the rendering of an image is to simply call as a background of a div tag.", and elsewhere I read that that if you use CSS for images the images will come up last (after your text), which is what I want. But I don't want to load up my css page with a long list of images (40), becuase the CSS page is loaded into the visitor's browser, and so will slow the length of time it takes to bring up my site. I really don't want to use sprites. Isn't there a way where I can load the images into a PHP includes file and refer to the includes file in the CSS, but what code would I use in the main coding (HTML) from page to page to bring up the different images for different pages? Thanks for the help
-
Answer:
You could pass a parameter in your URLs query string, like: mypage.php?img=1 Then you can name your CSS file something like: style.css.php In your CSS file you can do something like: $img = $_GET['img']; If ($img > 0 && $img < 5) { print "#myDiv { background-url: image1.jpg }"; } else { print "#myDiv { background-url: image2.jpg }"; } Or you know, use whatever argument you want within your if statement.
Lisa at Yahoo! Answers Visit the source
Related Q & A:
- How do I use my nickname instead of my real name on messenger?Best solution by Yahoo! Answers
- How do I use a picture instead of my avatar for chat?Best solution by Yahoo! Answers
- How do I use a picture instead of an avatar on Yahoo?Best solution by Yahoo! Answers
- Can you use a picture instead of an avatar in the yahoo chat?Best solution by Yahoo! Answers
- Can I use wax paper instead of parchment paper?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.