User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 425,765 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,369 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 603 | Replies: 3
Reply
Join Date: Jul 2007
Posts: 15
Reputation: Persist01 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Persist01 Persist01 is offline Offline
Newbie Poster

Wrapping text around odd-shaped image

  #1  
May 16th, 2008
Hi,

is there an easy way to wrap text around an odd-shaped image?

Please refer to attached image. I need text to float around the green image but the image isn't perfectly symmetrical.

Any tips would be much appreciated.

I've tried googling but have had no luck. Maybe I'm not googling the right search words.

It must be possible without being overly complex using css??
Attached Images
File Type: jpg wrap_around.jpg (31.4 KB, 4 views)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,556
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 115
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Wrapping text around odd-shaped image

  #2  
May 17th, 2008
No, because all images are really rectangles. The rest of that image is transparent. But the browser has no idea where the content is within the rectangular image.

I have some ideas:

1. Cut the image in two. But placement is tricky.

2. If the image is really solid green like that, you could make it with table components.

3. Put the text in a larger image containing both.
Last edited by MidiMagic : May 17th, 2008 at 3:03 am.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Jul 2007
Posts: 15
Reputation: Persist01 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Persist01 Persist01 is offline Offline
Newbie Poster

Re: Wrapping text around odd-shaped image

  #3  
May 17th, 2008
Thanks for your suggestions MidiMagic.

I tried option 1. Placement was very tricky and eventually I gave up on this option.

Unfortunately the image is not solid green.

I had thought about option 3 but prefer to avoid this option.

I ended up using the image as a background and putting each line of text into a span with left padding. Not exactly pretty html but it gets the job done whilst keeping it to 1 image without text in the image.

Don't ask me about alt and title text for the background image though

If anyone is interested I also just found the following url which talks about slicing up the image for curving and wrapping the text around it... [url="http://meyerweb.com/eric/css/edge/raggedfloat/demo.html"]
Reply With Quote  
Join Date: Jan 2007
Posts: 2,556
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 115
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Wrapping text around odd-shaped image

  #4  
May 20th, 2008
You ought to check that span method on other browsers and screen resolutions. The text positioning might change drastically.
Daylight-saving time uses more gasoline
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb HTML and CSS Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 2:34 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC