Advanced Search Usage Terms Submit Contact
Dynamic Drive CSS Library
 
CSS Library
Submit an original CSS code
CSS Layouts
Web Graphics
Online Tools:

Advertise Here

CSS Library: Image CSS: Here

Floating image with no text wrap

Author: Dynamic Drive

By default, floating an image causes the surrounding text to wrap around it, such in in the below example:

A safari park is a large nature reserve intended for safari tours and encounters with rare wildlife. They are common in Africa, but many exist elsewhere, including popular parks in England. People who wish to see animals in their natural state will love a trip to the safari.

However, sometimes you may want a different effect whereby the image floats, yet the surrounding content do NOT wrap around the image. This can be accomplished through the familiar "float" attribute, combined with "margins", while taking into account IE'6 dreadful "3px text-jog bug". The result is:

A safari park is a large nature reserve intended for safari tours and encounters with rare wildlife. They are common in Africa, but many exist elsewhere, including popular parks in England. People who wish to see animals in their natural state will love a trip to the safari.

The CSS:

The HTML:

Code Info

Rate this code:

Date Posted: 05/02/2006

Revision History: None

Usage Terms: Click here

Your Comments (40)

Got a question or need help customizing this CSS code? Post it in the CSS Forums. If you have a comment or suggestion instead, post it in the comments section below.

Comment Pages 4 of 4 pages « First  <  2 3 4

Theres this as welll

" style=
<div style="margin-left: 120px; width:200px">
Text goes here...Text goes here ...Text goes here
</div>
Posted by Erik on 10/06, 01:11 PM
Sorry I'll try that again,

<img src="yourimage.jpg" style="float:left" />

<div style="margin-left: 120px; width:200px">

Text goes here...Text goes here ...Text goes here

</div>
Posted by Erik on 10/06, 01:21 PM
Your idea works, prefer it because of the simplicity. I tried it. Kenya Safaris
Posted by Kenya Safaris on 11/01, 04:25 PM
This is an amazing post! I will have it bookmarked. You have got my thumbs up. Thanks for sharing :)
Foreclosure Listing Reviews
Posted by REO Listing Reviews on 11/04, 12:41 PM
Thanks for the useful guide.Its working well.
Keep on the good work!
Posted by tenerife car rental TIPs on 11/07, 02:03 AM
I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!
anti aging cream eye wrinkle cream
Posted by face lift cream on 11/07, 02:06 AM
Couldn't be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!
African American Sites
Posted by African American on 11/11, 01:27 AM
You do have a point here :) I admire the stuff you post and the quality information you offer in your blog! Keep up the good work dude.
Casa a New York
Posted by Loft a New York on 11/12, 09:34 PM
Well, indeed, it could be better.

I managed to solve the space on the right side, towards the text, without putting space on the left side. Until now I used the horizontal spacing option in HTML...

Now the problem that remains: how to solve the "deep white space" under the image?
Posted by Travel Library on 11/13, 03:31 AM
Your blog came up when I searched for help. This was actually what I was looking for, and I am glad that I finally came here! Thks for sharing and keep up the good work! Document Drying
Posted by Document Restoration on 11/26, 02:00 AM

Comment Pages 4 of 4 pages « First  <  2 3 4

Name: (Required)

Email: (Required)

(NOT shown on page)

URL:

(Shown on page if entered)

Comments: (Required)

Supported BB codes: [b], [i], [u], [em], [strike], [strong], [pre], [code], and [blockquote].

Remember my personal information
Notify me of follow-up comments?

Submit the word you see below ("previewing" post does not require it):


Copyright 2006-2008 Dynamic Drive Read our Usage Terms before using any of the CSS codes.
Dynamic Drive DHTML and CSS Code Library