CSS DIV styling to center a vertical image?
Quick question and I'm sure the answer is easy…but…
Am trying to place some vertical images in my table which we styled like this to create space between the images. HTML Code:
<div style="margin-top:30px;"></div> |
Yep, it is an easy one. :congrats:
What we had setup is a single table column, and inside it used HTML for doing two things: CSS spacing and calling images. It alternated down the page: space, image, space, image, space, image. (For anybody else reading, the CSS was inline to keep it easy for the end-user to copy/paste, and have the ability to alter, without having to edit any style sheet.) Instead of DIV then IMG, let's wrap the IMG in a DIV. :hmm: Old: HTML Code:
<div style="margin-top:30px;"></div><img src="path/to/image.jpg"> HTML Code:
<div style="margin:30px auto 0;"><img src="path/to/image.jpg"></div> Anyway, that simple nesting of the IMG tag inside the DIV should do exactly what you want. :) ____________
|
Hey Chief--
Thanks for the advice. Looks like the fly is still in the CSS ointment? Or maybe the table style ointment? Here's the code, I'll adjust the link later: HTML Code:
<a href="http://dustydoddridge.photoshelter.com/gallery-image/Canyonlands-of-the-Southwest/G000036j5XZFn1.4/I0000pRjGloU38LU" target="_blank"></a> http://focalpointacademy.com/photo-w...hwest-usa.html |
Your code is in the wrong order.
What you're trying to do in that code is make a DIV have a link -- and that's not going to work. This is the proper order: HTML Code:
<div style="margin:30px auto 0;">
Easy. :congrats: |
Thanks chief--
Still not behaving so maybe there is some peanut butter in the toaster... Code as it appears in the table: HTML Code:
<div style="margin:30px auto 0;"> <a href="http://dustydoddridge.photoshelter.com/gallery-image/Canyonlands-of-the-Southwest/G000036j5XZFn1.4/I0000pRjGloU38LU" target="_blank"> </a><img src="http://focalpointacademy.com/wp-content/uploads/2012/11/dd_20121109_9376_master.jpg"> </div> |
1 Attachment(s)
This one, right?
Attachment 3117 There may be some competing CSS going on, between the theme, the tables plugin, and the manual CSS. And it may be uncorrectable. Or at very least, hard as hell to adjust, without entirely rewriting lots and lots of CSS. - Perhaps don't use verticals? - Or simply live with it being left justified? (I think it looks fine that way.) |
Thanks lordSmurf--
Yep, will probably not use verticals in the end. Could also do a workaround in PS but not worth the time. Will probably just stick with the horziontals... --DD |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.