Css Float???

This is a discussion on "Css Float???" within the Web Page Design section. This forum, and the thread "Css Float??? 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 Aug 13th, 2007, 10:21
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 172
Thanks: 0
Thanked 1 Time in 1 Post
Css Float???

Hi All,

I am relatively new to styling my layouts with pure css, I am a table layout designer trying to make the switch to css.

I am wanting to add an image to my layout to the right of my div container, I am looking to do something like below but using css.



If you could possible set me in the right direction it would be most appreciated.

Wayne
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 Aug 13th, 2007, 10:29
Highly Reputable Member
Join Date: Jun 2007
Location: Canterbury
Age: 20
Posts: 726
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Css Float???

The image should be inside the div with the text, and you need to give it a class something like this:

HTML
Code: Select all
<img src="yourimage.jpg" alt="your image description" class="floatRight" />
CSS
Code: Select all
.floatRight {
float:right;
padding: 0 0 0.5em 0.5em;
}
The float: right floats it in the text, and right makes to float on the right rather than left. The padding is just so there is a bit of spacing between the left and bottom edges of the pic and the text. Remember when padding you can do the values as

padding: top right bottom left;

Thats what i've done above.
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 Aug 13th, 2007, 10:32
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 172
Thanks: 0
Thanked 1 Time in 1 Post
Re: Css Float???

Would I need to put a div class around my image?
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 Aug 13th, 2007, 10:34
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 172
Thanks: 0
Thanked 1 Time in 1 Post
Re: Css Float???

sorry I have just noticed the class in the image source
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 Aug 13th, 2007, 10:37
Highly Reputable Member
Join Date: Jun 2007
Location: Canterbury
Age: 20
Posts: 726
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Css Float???

Wll that didn't post properly. but if you understand then...I'll leave it at that!
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

Tags
css float

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 float problem milly Starting Out 3 Jul 9th, 2007 02:51
Float problems timmytots Web Page Design 4 May 11th, 2007 14:18
Problems with float:left float:right nvidiajoe Web Page Design 8 Nov 17th, 2006 20:24
float question... asa_carter Web Page Design 4 Aug 27th, 2006 00:18
IE6 Float masonbarge Web Page Design 8 Aug 16th, 2006 10:13


All times are GMT. The time now is 06:13.


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