Image and text caption problem

This is a discussion on "Image and text caption problem" within the Web Page Design section. This forum, and the thread "Image and text caption problem are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Feb 26th, 2008, 13:37
New Member
Join Date: Feb 2008
Location: London
Age: 19
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Image and text caption problem

Hello everyone, I'm newish to CSS and I'm in the progress of designing a site from scratch with xtml and css.

First of all, my xhtml and css validate fine. xhtml validates as strict.

On this page - http://speed.george-edwards.co.uk/in...resources.html - that I've designed, you can see a few images, then a bit of text that go with them. Ideally I want them to be spaced out evenly down the page, with the text aligning itself with the top of the image. I've tried accomplishing it with floats and tinkering with the margins and paddings, but I can't seem to get the result I want.

At the moment the problem is that either the images aren't spaced out evenly (although this maybe because they are of different dimensions?), and also the text is getting pushed around by the text above it - i.e. it's out of line with the image next to it.

For example, I would like this all the way down the page:

PICTURE | TITLE
PICTURE | Lorem ipsum........
PICTURE |
PICTURE |

However, I'm getting results like this:

PICTURE |
PICTURE |
PICTURE | TITLE
PICTURE | Lorem ipsum......

And so on...

Sorry for the long post - any help will be gratefully received.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Feb 26th, 2008, 13:45
Reputable Member
Join Date: Oct 2007
Location: UK
Posts: 266
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image and text caption problem

Try putting your images and text ech in seperate divs then float right and left, eg......

#image{
float: left;
}


#text{
float: right;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Feb 26th, 2008, 13:50
New Member
Join Date: Feb 2008
Location: London
Age: 19
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image and text caption problem

That makes it go completely wrong, and I get a float problem with the images stepping inwards down the page...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Feb 26th, 2008, 14:16
Reputable Member
Join Date: Oct 2007
Location: UK
Posts: 266
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image and text caption problem

Hmmm, ok, make a container 500px wide and float it right. Dont set a height to it obviously. This container will hold your text and images..........

Then inside this container, have another container to hold your images in, float it left and make it about 130px wide.

Then make yest another container to hold your text, 370px wide and float right.

Something along the lines of........

HTML
Code: Select all
<div id="main_container">
<div class="images">Images in here</div>
<div class="text">Text in here</div>
</div>

CSS
Code: Select all
#main_container{
width: 500px;
float: right;
}

.images{
width: 130px;
float: left;
}

.images{
width: 370px;
float: right;
}
This may not get it looking perfect straight off but you'll definately be going in the right direction.

Hope this makes sense

Danny322
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Feb 26th, 2008, 16:19
New Member
Join Date: Feb 2008
Location: London
Age: 19
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image and text caption problem

Thanks, I'll give it a whirl. I'm guessing there was a typo in your code as both CSS properties were .images where the float: right one should have been text? hehe no problem.

I'll let you know how I get on.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Feb 26th, 2008, 16:49
New Member
Join Date: Feb 2008
Location: London
Age: 19
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image and text caption problem

Danny - getting there now. I've got a similar result to how I started out with. I had to clear: left the images to stop some typical float issues coming up with stacking.

Stage 2 - haha - how would you recommend setting the margins so it's all spaced out properly? Thanks for your help so far.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Feb 26th, 2008, 21:16
Reputable Member
Join Date: Oct 2007
Location: UK
Posts: 266
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image and text caption problem

Try adding padding-top: 16px; to your 'innerContentImages' CSS

.innerContentImages {
width: 130px;
float: left;
clear: left;
padding-top: 16px;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Feb 27th, 2008, 16:44
New Member
Join Date: Feb 2008
Location: London
Age: 19
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image and text caption problem

Thanks, with your help I'm getting there. It's even more perfect when the images are all the same size.

But for now, I've perfected that thanks to your help Danny...but...........

Could someone take a look at this weird IE7 bug for me... head along to: http://speed.george-edwards.co.uk/services.html in any standards compliant browser (Camino, Safari, Firefox, etc). Notice that the text titles line up perfectly with the image (thanks, Danny, once again).

But then look at the same page with IE7, and see how the bottom element lines up - "Irregular Dimensions and Weight" - IE7 renders it higher up and out of line. I've tried lots of things, the display: inline fix, desperately made a new CSS property with a greater top margin.. etc

Any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Feb 27th, 2008, 18:14
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image and text caption problem

Hi

In your innercontenttextfinal, try replacing margin-top: 3em with padding-top: 40px;

I havent tested it but it might work.

Cheers Pat
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Image with text -&gt; text with background alexgeek Web Page Design 5 Nov 13th, 2007 23:25
Text over an image casho Web Page Design 9 Aug 14th, 2007 12:51
Beginner needs help on image & caption layout badger Web Page Design 3 Jun 21st, 2007 11:32
Text/image swap LorEye Website Planning 2 May 19th, 2007 17:43
text next to image ivyholly Web Page Design 5 Dec 21st, 2005 15:49


All times are GMT. The time now is 03:38.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42