Wrox Programmer Forums
BOOK: Beginning HTML, XHTML, CSS, and JavaScript
This is the forum to discuss the Wrox book Beginning HTML, XHTML, CSS, and JavaScript by Jon Duckett; ISBN: 978-0-470-54070-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML, XHTML, CSS, and JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 13th, 2011, 09:55 AM
Registered User
Join Date: Sep 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default CSS, Img, Border issues

So, I'm going crazy here.

I have an image that is included in my <div></div> for the page. The img is 700x553. When I set up the border of the div element, the img sticks out pass the border. Now, I can use height to fix that; however, then my other pages (no img) is too long.

I was closely following similar steps as from the example website created in this book for my base design, and I had a similar issue in Chapter 7 example when adding a border around the <div> element. However; after adding a defined width (960px)like in the book example, the border seemed to auto-adjust to the image in the sample webpage.

I cannot get that to work in my own sample. I have no clue why, and experimenting with different widths does not work. Again, height does, but that screws up my other pages using the stylesheet.

Any helpful advice regarding img stuff in CSS would be awesome. Basically, it seems like the img isn't getting treated as part of the <div> element, but I have no clue why or where to look to fix it. :(

Edit: Nevermind, figured it out. Absolute positioning fixed it on the div css property. Not sure why I had to use that when I didn't in the example site. :/

Last edited by OriginZero; September 13th, 2011 at 10:53 AM..

Similar Threads
Thread Thread Starter Forum Replies Last Post
IE Issues with CSS phpuser2000 CSS Cascading Style Sheets 0 December 19th, 2007 12:13 PM
HELP: CSS COLLAPSIBLE LIST ISSUES phpuser2000 CSS Cascading Style Sheets 0 December 13th, 2007 04:22 PM
IE layout issues with tables and border. dekemcaffee Javascript 1 October 9th, 2007 04:57 PM
CSS for Table border. rupen CSS Cascading Style Sheets 2 March 29th, 2006 09:41 AM
img maps and Border Colors interrupt CSS Cascading Style Sheets 2 September 10th, 2005 05:28 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.