Reply LinkBack Thread Tools Search this Thread
Old 28-09-2005, 13:58   #1 (permalink)
xml
Senior Member
 
Join Date: Sep 2004
Posts: 149
Div/img positioning problem

I'm tryna perfect a design, but i'm having issues with float divs overlapping.

Heres an example

As you can see some of the results look funky. I know tables would sort out this problem, but that I hope is a last resort.
__________________
  Reply With Quote
Old 28-09-2005, 13:59   #2 (permalink)
mike_m
Work faster microphone ..
 
mike_m's Avatar
 
Join Date: Feb 2003
Location: Dubai
Posts: 1,739
4th pic down yeah? having the exact same problem myself today - sure it's something simple, but am drawing a blank at the minute...
__________________
  Reply With Quote
Old 28-09-2005, 14:08   #3 (permalink)
xml
Senior Member
 
Join Date: Sep 2004
Posts: 149
__________________
  Reply With Quote
Old 28-09-2005, 14:17   #4 (permalink)
gray
i still want paying
 
gray's Avatar
 
Join Date: Oct 2003
Location: newcastle, uk
Posts: 4,836
clear: both; ?
  Reply With Quote
Old 28-09-2005, 14:39   #5 (permalink)
xml
Senior Member
 
Join Date: Sep 2004
Posts: 149
Due to the mixture of Divs "clear: both" just fucks it up further.

I'm just gonna have to go with TABLES *gasp*
__________________
  Reply With Quote
Old 28-09-2005, 14:55   #6 (permalink)
mike_m
Work faster microphone ..
 
mike_m's Avatar
 
Join Date: Feb 2003
Location: Dubai
Posts: 1,739
same here, due to the layout being dependant on floats, clearing them makes a mess of the whole thing..
__________________
  Reply With Quote
Old 28-09-2005, 17:10   #7 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,206
what are we meant to be looking at?
  Reply With Quote
Old 28-09-2005, 18:32   #8 (permalink)
mike_m
Work faster microphone ..
 
mike_m's Avatar
 
Join Date: Feb 2003
Location: Dubai
Posts: 1,739
this: http://www.feedsfarm.com/s/s-20-iraq...o.com&z=-86400

but he seems to have fixed it - will have a look through the code tomorrow

edit: oh dear, resorted to tables
__________________
  Reply With Quote
Old 29-09-2005, 07:33   #9 (permalink)
xml
Senior Member
 
Join Date: Sep 2004
Posts: 149
Sorry bout that, had to change it for the users.

Luckily Opera cached it from when I was checking the layout in that browser.

Heres what it looks like using divs (the problem is the overlaps):

http://images.feedsfarm.com/screeny-old.png

Heres the desired effect which I've got using the undesirable table elements :

http://images.feedsfarm.com/screeny-new.png

Its a search engine, and I'm an XML developer so I want to use DIVs because:

*) Usability
*) Standards
*) Less HTML required, less TCP/IP packets, less data to serve to users.
__________________
  Reply With Quote
Old 29-09-2005, 10:13   #10 (permalink)
Twistmedia
Graphic Design Web Design
 
Twistmedia's Avatar
 
Join Date: Feb 2005
Location: Wales UK
Posts: 36
If you add another line of text to the text on the caption above where the float is breaking should sort it out, but not the ideal asnwer, or for now you can put a padding in the stylesheet with reference to the <p>paragraphs of text</p> add a 20 or so padding on bottom (this is a quick quess without looking at your code ans css) So hold the flames

Having a pigs year with floats also.
  Reply With Quote
Old 29-09-2005, 10:17   #11 (permalink)
mike_m
Work faster microphone ..
 
mike_m's Avatar
 
Join Date: Feb 2003
Location: Dubai
Posts: 1,739
Yeah i just added some padding to the bottom of the paragraph, which isn't ideal, but will do for the moment..
__________________
  Reply With Quote
Old 29-09-2005, 10:33   #12 (permalink)
finbarr
who the fuck am i?
 
finbarr's Avatar
 
Join Date: Apr 2005
Location: london
Posts: 2,670
Send a message via MSN to finbarr Send a message via Skype™ to finbarr
this might point you in the right direction:link
  Reply With Quote
Old 29-09-2005, 13:18   #13 (permalink)
mike_m
Work faster microphone ..
 
mike_m's Avatar
 
Join Date: Feb 2003
Location: Dubai
Posts: 1,739
that almost worked, but not quite, here:

original page: http://www.joh.cam.ac.uk/testing/admissions/

with the above method : http://www.joh.cam.ac.uk/testing/admissions2/

I'm a little closer, but still completely baffled.
__________________
  Reply With Quote
Old 04-10-2005, 02:37   #14 (permalink)
Denver
Registered User
 
Denver's Avatar
 
Join Date: Nov 2004
Posts: 14
http://www.456bereastreet.com/archiv..._in_body_text/
That link worked great for me. Try it.
  Reply With Quote
Old 04-10-2005, 05:49   #15 (permalink)
Transmogrify
Rough Creep Arse™
 
Transmogrify's Avatar
 
Join Date: Jul 2005
Location: Vancouver, Canada
Posts: 1,888
Send a message via MSN to Transmogrify
My personal opinion is that is tabular data anyway, so I can't see any issues using tables in that instance.
  Reply With Quote
Old 04-10-2005, 06:26   #16 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,206
no it's not tabular data.

there's a million and ten ways of doing it. I'd probably use definition lists.

I've used percentages as you're going for a fluid layout.

css
Code:
dl { width: 70%; clear: both; } dt { float: right; width: 80%; } dd { float: right; width: 80%; margin: 0; } dt.image { float: left; width: 20%; } dt.image img { display: block; }

xhtml
Code:
<dl> <dt class="image"><img width="108" height="162" border="0" src="http://www.joh.cam.ac.uk/cms_misc/images/admissions/students.jpg" alt="St John's Students" title="St John's Students" /></dt> <dt><a href="http://www.joh.cam.ac.uk/admissions/undergraduate/">Undergraduate</a></dt> <dd> <p> In this section we aim to provide a wealth of information for prospective applicants, current applicants, teachers and parents.&nbsp;&nbsp;You will find sections on the admissions process, subjects available, student life, options for visiting the College, Open Days, Fees and Charges and much, much more besides! We cannot, however, anticipate all your individual queries, so if you cannot find the answers to your questions on this site we warmly invite you to <a href="http://www.joh.cam.ac.uk/admissions/undergraduate/contact/">contact us</a> directly, and we will be pleased to assist in any way we can. </p> </dd> </dl> <dl> <dt class="image"><img width="108" height="166" src="http://www.joh.cam.ac.uk/cms_misc/images/admissions/On-Bridge-3.2.3-A.jpg" alt="On the Bridge of Sighs (by Nigel Luckhurst)" title="On the Bridge of Sighs (by Nigel Luckhurst)" /></dt> <dt><a href="http://www.joh.cam.ac.uk/admissions/graduate_admissions/">Graduate</a></dt> <dd> <p>This section provides information about life as a Graduate Student at St. John's College and on how to apply to the University for a graduate course.</p> </dd> </dl>
  Reply With Quote
Old 04-10-2005, 06:50   #17 (permalink)
Transmogrify
Rough Creep Arse™
 
Transmogrify's Avatar
 
Join Date: Jul 2005
Location: Vancouver, Canada
Posts: 1,888
Send a message via MSN to Transmogrify
How is it not tabular data?
  Reply With Quote
Old 04-10-2005, 06:52   #18 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Where's the rows and columns? There's no cross-referencing possible...it's not tabular.
  Reply With Quote
Old 04-10-2005, 07:00   #19 (permalink)
finbarr
who the fuck am i?
 
finbarr's Avatar
 
Join Date: Apr 2005
Location: london
Posts: 2,670
Send a message via MSN to finbarr Send a message via Skype™ to finbarr
Quote:
Originally Posted by smallbeer
no it's not tabular data.

there's a million and ten ways of doing it. I'd probably use definition lists.
Interesting never thought of doing that!
  Reply With Quote
Old 04-10-2005, 07:04   #20 (permalink)
Transmogrify
Rough Creep Arse™
 
Transmogrify's Avatar
 
Join Date: Jul 2005
Location: Vancouver, Canada
Posts: 1,888
Send a message via MSN to Transmogrify
fair enough
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8