Image alignment & Drop shadows
If you like this post, please subscribe to our RSS feed to read our new posts every day.
Mark posted a while back (link) a quicktags improvement that included the ability to have drop shadows around your image.
Visit that link to get the code and follow the instructions for adapting your current setup.
I’ve adapted it so that the image can now be left or right aligned with text wrapping, and I’m assuming that you have added the CSS from that link to your ‘wp-layout.css’.
Add the following to your wp-layout.css;
.img-shadow1 {
clear: both;
float:right;
background: url(images/shadowAlpha.png) no-repeat bottom right !important;
background: url(images/shadow.gif) no-repeat bottom right;
margin: 20px 0 0 17px !important;
margin: 20px 0 0 8px;
}
.img-shadow1 img {
display: block;
position: relative;
background-color: #fff;
border: 1px solid #a9a9a9;
margin: -6px 6px 6px -6px;
padding: 4px;
}
div.clearer {
clear: left;
line-height: 0;
height: 0;
}
The instruction <div class=”img-shadow”> will produce a left aligned image.
The instruction <div class=”img-shadow1″> will produce a right aligned image.
While the Quicktag will insert the top of those 2 codes, it will not produce the second. You will have to add the ‘1′ manually.
A couple of points;
- You must have a carriage return after the closing </div> and before your text. If you do not, your text will be in bold This will not unduly affect your text wrap.
- If when you view your entry, the image has ‘broken through’ and is affecting the entry below it, you will need to use the clearer div. This needs to go after the last image in your post, but before any text that follows it. An example:
You post a picture, with text, and the image breaks through. You need to alter your post to insert the clearer:
<div class="img-shadow1"><img src="ducks.jpg" alt="" /></div><div class="clearer"> </div>
magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation …
Information on this is also at www.tamba2.org.uk/graphicalcss
Visitors who read this post, also read:
Related posts from the past
- WordPress Javascript Quicktags
- Customise the WordPress Comments Page
- Avatar Pop-up
- How to: Offsets and Paging
- Paging and Custom WordPress Loops
- Removing Width/Height from the Image Uploader
- How to Only Retrieve Posts With Custom Fields
- A Unique Monotone
- Javascript Quicktags Updated
- How To: Avoid Duplicate Posts












Comments RSS
That is a damn fine page, Podz. I will be dumping my version and referring the link to your page. It’s sweet! Excellent job.
[Reply]
Craig (19 comments.) — 04/12/2004 @ 10:31 pmDon’t do that Craig !
You have information on your page which I have not covered, and may not in the end cover, so I think it’s more useful that the pages compliment each other, that way a wider range of WP users can be catered for.
And anyway, I linked to you
[Reply]
Podz — 04/13/2004 @ 9:46 amIt would be nice if it could be integrated with buttons and all.
[Reply]
David Blangstrup — 04/21/2004 @ 9:46 amHi. Good info. However I can’t seem to get the clearer tag to work properly. If you have al ook at my site you’ll see a pic plunging south into the post below it. I’ve got the tags correctly entered in the CSS as well, so I”m not sure what the issue is. Any ideas?
[Reply]
Matt (1 comments.) — 07/7/2004 @ 6:23 pm[...] e. Récupération des Quicktags en question. Faire exactement ce qui est indiqué. Ajouter d’autres modifications pour avoir l’alignement à [...]
SPG0 » Wordpress Quicktags — 07/14/2004 @ 5:00 pm[...] ..
Image alignment & Drop shadows
04/30/2004
Image alignment & Drop shadows for Wordpress [...]
CHOPSOCKY » Image alignment & Drop shadows — 07/17/2004 @ 3:22 am[...] « | Home 8/30/2004
Image alignment & Drop shadows
bookmarks » — 08/30/2004 @ 3:18 pm(CSS, W [...]
Is it possible to center a drop-shadowed image?
[Reply]
indi (2 comments.) — 10/22/2004 @ 9:28 amThanks for the image alignment ideas. It is difficult for me, I am only new to all this.
[Reply]
Amie Stilo (2 comments.) — 01/10/2008 @ 5:37 am