Divs and floating images

This is a discussion on "Divs and floating images" within the Web Page Design section. This forum, and the thread "Divs and floating images are both part of the Design Your Website category.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 27th, 2007, 20:27
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Divs and floating images

I have a problem and don't know how to sort it out
I have an image which is 400 x 400 which currently is floated left.

I also have a paragraph of text which I would like to be positioned under the image but becuase the div is wider than 400px the text is wrapping around the image.

I am using a 3 column liquid layoutso if the user resizes their browser window it all adjusts correctly.

I did have an idea that I could use a div to hold the image and a seperate div to hold the text content. Both of these divs would be in a container div but what I tried didn't work, the text still wrapped aroud the image.

How can i set the 2 div widths and position the image centered so the text stays at the bottom of the screen?
Reply With Quote

  #2 (permalink)  
Old Mar 27th, 2007, 20:46
Reputable Member
Join Date: Dec 2005
Location: scotland
Age: 27
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Divs and floating images

postion : 0 may put the image to the bottom (if i understand the problem correctly then apply margin : 0 auto; to centre it.
probably going down the wrong route ... too much wine
Reply With Quote
  #3 (permalink)  
Old Mar 27th, 2007, 22:47
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Divs and floating images

position: 0; is not CSS. Positioning is not what you're going to want to use. I'm a little confused. Are you saying you want the image to be aligned to the left but the text to start under it instead of beside it?
Reply With Quote
  #4 (permalink)  
Old Mar 27th, 2007, 23:33
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 21
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Divs and floating images

Try wrapping the text in a seperate div and using clear: both; on it that way it should appear under ('clear') any floated elements above it, but again I don't really know what you're getting at. That was just a stab in the dark.


Post a link or a screenshot if you can.

Pete.
Reply With Quote
  #5 (permalink)  
Old Mar 27th, 2007, 23:49
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Divs and floating images

Here's one example that I did (Oh no is Ryan going to find a mistake?)
The HTML
Code: Select all
  <div class="divright"><img src="otherservicepic.jpg" alt="" width="200" height="150" />
 <p class="picrightp">Construction Services</p>
</div>
The css
Code: Select all
.divright {
	width: 200px;
	float: right;
	margin-right: 15px;
	margin-left: 15px;
	
	}
This stacked a photo over a description that said Construction Services
Gee, I hope that helped!
Reply With Quote
  #6 (permalink)  
Old Mar 28th, 2007, 01:16
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Divs and floating images

Since you're shaking in your boots, Linda:

Code: Select all
.divright {
    width: 200px;
    margin: 0 15px;
    float: right;
}
Yours is correct, however. I just like shorthand.
Reply With Quote
  #7 (permalink)  
Old Mar 28th, 2007, 05:43
sannbe's Avatar
SuperMember

SuperMember
Join Date: Dec 2006
Location: San Francisco
Age: 57
Posts: 1,567
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Divs and floating images

Quote:
Originally Posted by Ryan Fait View Post
Since you're shaking in your boots, Linda:

Code: Select all
.divright {
    width: 200px;
    margin: 0 15px;
    float: right;
}
Yours is correct, however. I just like shorthand.
Linda,

Ryan's toast. No more Mr. I just like shorthand. I'm sure we can find a good place to hide the body.
lol Sara
Last Blog Entry: More Sara Blogging (Nov 29th, 2007)
Reply With Quote
  #8 (permalink)  
Old Mar 28th, 2007, 10:48
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Divs and floating images

Wahooooooooo... I was right! That's all I care about!!

Now let's hope it works for the Ad Rock!
Reply With Quote
Reply

Tags
center, div, images

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
CSS - floating divs and images help Emzi Web Page Design 8 May 29th, 2008 17:58
floating divs problem in IE r0ck80y Web Page Design 4 May 19th, 2008 14:43
Problem with css content box made from divs and background images weasel Web Page Design 3 Aug 9th, 2007 22:48
Floating a SWF file?? iStylus Web Page Design 6 Apr 17th, 2007 11:59
floating problems... gogogadgetearl Web Page Design 0 Jul 16th, 2005 04:25


All times are GMT. The time now is 18:54.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs 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 43