Welcome to Dream.In.Code
Become an Expert!

Join 149,526 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,464 people online right now. Registration is fast and FREE... Join Now!




image divs problem with spacing

 
Reply to this topicStart new topic

image divs problem with spacing, can't figure this out

nightchoir
21 May, 2007 - 04:29 PM
Post #1

D.I.C Head
**

Joined: 16 Jul, 2006
Posts: 81


My Contributions
on a page i'm working on, http://www.dassomnambulist.com/new/item.shtml, i would like the image featured (the poster), to have a border like the following.

IPB Image

here's the code i have on my html file for it...

CODE
<div class="imageborderout"><img src="images/capsule.jpg" class="imageborderin" alt="" border="0" /></div>


and here's the code in the css file...

CODE

.imageborderin {
    border: 1px #000000 solid;
    padding: 1px;
}

.imageborderout {
    border: 2px #000000 solid;
    padding: 1px;
}


i can't figure out how to make the div stay at the width i want it to, other than using a width property, but i would like it to fit so that no matter what size the image is, it will not have a ton of negative space on any side. also, this didn't work with a span tag, as it was only like, one pixel tall.

thanks for any help!
User is offlineProfile CardPM
+Quote Post

Arbitrator
RE: Image Divs Problem With Spacing
22 May, 2007 - 05:50 PM
Post #2

D.I.C Regular
Group Icon

Joined: 26 Jan, 2005
Posts: 492



Thanked: 1 times
My Contributions
I don’t think that your request is clear. Did you want to center the image?

I would fix your code, by the way. You can see your errors here (W3C) and here (Validome). You’re going to need a document type declaration if you want your HTML and CSS to work reliably between browsers (see why). I’d recommend an HTML 4.01 DTD.
User is offlineProfile CardPM
+Quote Post

nightchoir
RE: Image Divs Problem With Spacing
23 May, 2007 - 08:35 PM
Post #3

D.I.C Head
**

Joined: 16 Jul, 2006
Posts: 81


My Contributions
i actually fixed it by floating both borders to the left and then using a clear left on the wrapper div.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 08:47PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month