In CSS, how do I place an image directly above or below a background image?
-
The body div of my website has a repeating background image. I wish to create an effect of three-dimensionality by dropping a shadow from the bottom of the background image and adding a little structure to the top of the background image. These âstructureâ images have already been created in Photoshop. All I would like to do is place them directly above and below the bodyâs background image. Can anyone suggest the proper CSS syntax to do this?
-
Answer:
Thanks, Alexander. Iâm afraid I should have been more specific. I attribute the confusion to the fact that I didnât really know what I was doing. My html is generated by php files, but Iâm using WordPress, so I didnât build the php myself. I wanted to insert an image above a âcontentâ div. I wondered, âDo I need to create a new div and position it above #content? Do I need to create a new class within #content and play with the âpositionâ tag?â It turns out I needed to do something like this: <?php get_header(); ?> <div id="content" class="col-full"> <img src="image.jpg"/> <div id="main" class="col-left"> I introduced the image within the #content div and then played around with the CSS: #main{width:600px; margin-left: 25px; margin-top: 20px; margin-bottom: 20px; } to get it positioned correctly.
Mike Specian at Quora Visit the source
Other answers
Very carefully. But srsly: body { background-image: url(bg.jpg); } div#theeffectofthreedimensionality { background-image: url(structure.jpg); position: absolute; left: /* insert x offset from left here */; top: /*insert y offset from top here */; width: /* what it needs to be */; height: /* the same */; overflow: hidden; } something like that should do it.
Alexander Bohn
Related Q & A:
- How do I display all categories on a page with a corresponding image?Best solution by Magento
- How can I put an image for my background on Myspace?Best solution by Yahoo! Answers
- How do I change a password directly in the PhpBB3 SQL database?Best solution by Server Fault
- How do I print my pictures from my phone on a printer directly?Best solution by techradar.com
- How do I put a picture directly in an e-mail?Best solution by Yahoo! Answers
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.