Home  »  Ideas  »  CSS Text Wrapper
Preview of CSS Text Wrapper

CSS Text Wrapper

Idea #35 - Posted in Launched Go-to Site Comments (60) - Traffic & Stats - Updates  -
  • Wrap content to any shape. Including curves, slants, non-linear images, or whatever you can think of
  • Trace images for quick creation
  • Content Independent Your content and text can change but your wrap shape will stay the same.
  • Multiple Export Methods help ensure you can find an efficient way to add the code to your site.

Overview

The CSS Text Wrapper allows you to generate HTML and CSS to wrap text on your website into any shape.

Jump down after the video for more information.

Video Example: How To Use the Wrapper

This video covers how the wrapping works, how to use the wrapper to create a simple text wrap around two circular images, and how to add the generated code to your website or blog.

How It Came To Be and Why It’s Better Than What’s Available


One of the things I do for contract work is coding PSDs to CSS/HTML. I stand by telling my clients, if they can design it, I can code it, so sometimes I get myself into a rut with a tricky design element. Well a design came along that had a curved layer of text around a curved graphic. The design was going into a CMS system so the content would be changed from time to time, and therefore needed to be independent of the markup. I found that by floating divs to the left and the right of the each line of content, you would be able to force the text into place. But it took a loooong time. Each div on each line required tweaking over and over again pixel by pixel until it was just right. There had to be a better way to do that.

Feedback

The Wrapper is very new and still needs a lot of work. So please leave me any problems you find, as well as suggestions and examples of work you’ve done with it!

FAQ

Q: Long single strings without spaces (like long URLS) do not wrap?
A: This unfortunately is the same behavior you’d see even if you didn’t use the wrap. Your browser will not break up long strings to wrap them. (Internet Explorer has some alternatives)

Q: Does this mean I have to use flash on my website?
A: No, flash is only used in the tool to create the wrap. You use it to draw the shapes you want to wrap, the tool then generates the CSS/XHTML code to make your wrap. No flash is required on your site.

Q: Can I use this with standard inline images (img tag) and not just backgrounds?
A: Yes, though you will need to use absolute positioning to put them into place.

The Idea Path (what's this?)

This idea is a direct result of work on:

Traffic & Statistics

Scale: small
Market: open
Revenue: N/A
Recent Monthly Averages:
Pageviews: 181,000
Visits: 111,000
Growth: up
Thought Up: Nov 16th 2007
Broke Code: Nov 18th 2007
Beta Release: Dec 4th 2007

Comments (60)


  1. Woah that is an original and well executed idea there Nate. And all done within a month to boot! Excellent job.

    Just letting you know that I tried it and I’ll be sure to write a review about it on my blog over the weekend.

    December 5th, 2007 Kevin X
  2. Nice Job!!!
    I’ll play with this tool soon.

    December 5th, 2007 Yoyo
  3. Very, very cool.

    December 5th, 2007 cerebralmum
  4. Great job and a fantastic tool.

    December 6th, 2007 Craig
  5. we we type “aaaaaaaaaaaaaaaaaaaaa.. without a space.. it doesn’t wrap.

    December 6th, 2007 anand
  6. single strig without spaces are not working just check it out..

    December 6th, 2007 tricker
  7. cool tool …

    Thanks

    December 6th, 2007 amit
  8. Why rely on a Flash injection (yuck) and a manual solution when an automatic CSS text wrapping solution named The Box Office has been around for over 2 years by now ;)

    December 6th, 2007 Bramus!
  9. @Bramus:
    The flash is only used to help you make the wrap. It then generates the CSS/XHTML code to add to your site. No flash is used on your site.

    December 6th, 2007 Nate Weiner
  10. A nice hack (’hack’ as in working around the current HTML/CSS limitations), but it’s a shame that in order for this to work, the image has to be placed on the page as a background image, which isn’t great from the point of view of accessibility (no alt text, and the image disappears if CSS is switched off) and maintainability (background images are specified in CSS, which is usually specified in an external style sheet).

    December 6th, 2007 Frankie Roberto
  11. @Frankie:
    Yea, I agree, it would be nice if it was somehow built into CSS. To avoid using background images, you could place the images into the text container using absolute positioning.

    December 6th, 2007 Nate Weiner
  12. @tricker & aand:
    Unfortunately, the functionality you describe appears the same way with or without the wrap when placing long unbroken strings in a div layer. Your browser (actually IE has some methods for this) won’t break apart long strings (or URLS) to wrap them. You would have to do it manually.

    December 6th, 2007 Nate Weiner
  13. I wonder whether it’d be possible to re-code it so that it uses img images with a z-index instead (would only work with absolutely positioned images though).

    December 6th, 2007 Frankie Roberto
  14. @Frankie:
    You’ve definitely got me thinking…
    In the next version I’ll see what I can do about allowing you to drag and drop images into the mix as well. Thanks for the suggestion!

    December 6th, 2007 Nate Weiner
  15. [...] Questions ? See video demo below or visit CSSTextWraper FAQ [...]

    December 11th, 2007 CSSTextWrap: Wrap Text Around Any Shape | MakeUseOf.com
  16. (HitchHickers Guide Rules)
    I like this new little application, but there are some options missing, such as a “bend” line option which I understand may be a little hard to do, or at least a “smooth” line option, or preset bend between 2 selected dots, eg, if someone wanted to do your example that looks a bit like a chamagne glass or something, the would do the straight bits, then select the dots between which they want the bend, and select a preset bend, It might save a lot of time on the behalf of the user. but that is just a suggestion, if it is too inconvenient don’t worry.
    “So long, and thanks for all the fish” :)

    December 11th, 2007 James O
  17. oops, that was supposed to be yellow for suggestion :(, oh well

    December 11th, 2007 James O
  18. Smells like Teen Inspiration | Can The World Hear Me

    It’s one of those ideas that make me ask myself “Why didn’t I think of that?”

    December 11th, 2007 Can The World Hear Me
  19. [...] CSS Text Wrapper: Website - See Examples - Video Demo - FAQs  [...]

    December 12th, 2007 » Wrap Text around any Shape using CSS Text Wrapper
  20. how can i make it work with height 100% or non specific height?

    December 13th, 2007 Mona
  21. @Mona:
    The height that you enter is really only for the workarea size. The height of your container won’t affect the wrap (as long as it’s as tall or taller than the wrap shape).

    December 13th, 2007 Nate Weiner
  22. [...] diesen Beitrag m?chte ich noch einmal gezielt hinweisen, obwohl ich ihn ?ber den Google Reader empfohlen habe und [...]

    December 15th, 2007 Thomas Lippert » Blog Archive » CSS Text Wrapper - kreativ mit CSS
  23. thanks. great job

    December 16th, 2007 Makavelis
  24. If we could to especify properties to background image, like position/repeat… It would be great.

    December 19th, 2007 Junior
  25. Just EXCELLENT!!!

    December 19th, 2007 Ray SF
  26. thanks great Tool ..

    December 19th, 2007 suresh
  27. Way way cool! Thanks for the contribution!

    December 21st, 2007 Fernan
  28. This is a cool tool. I used it for my mother’s web site, where she publishes stuff she’s writing. If you want to check, I used the text wrapper for one of her short stories, unter “Kurzgeschichten”, “Der Fuchs im Hühnerstall” (it’s in German).

    One thing, though, is it possible to make this for bottom aligned pictures? I used DIVs and used the images as background, aligned them top right and top left. Had no luck with bottom left. The text size is not fixed, so changing it with Ctrl-Mousewheel works up to a limit.

    It would be nice if one could specify background options life position and no-repeat in the flash tool.

    Anyway, this tool is very nice, saves you from having to make all the divs manually.

    Cheers,
    Michael

    December 23rd, 2007 Michael
  29. very good tool!

    December 28th, 2007 Webdesign
  30. This is really good. It can be done manually of course, but to have a code generating tool is really useful. I will link to this on my forum.

    January 7th, 2008 Web Design and Development Discussion Forum
  31. Thank you so much for such great tool!

    January 14th, 2008 Gafsveno
  32. this is really fun

    January 15th, 2008 eric
  33. I was think about circular shapes text contents for many time.

    Great work!

    January 22nd, 2008 Ruben
  34. Wow, I’m glad to receive this great information.
    Thank you.

    Holger

    January 24th, 2008 Holger
  35. I code in CSS a very long time, but this are nice information for me.

    Great!

    January 24th, 2008 Webdesign
  36. No text appears in the box whatever I do. I change the sample text, but the box with the adjustable lines still has no text in it whatsoever. Is this perhaps because I’m using Linux? Is the version of Flash for Linux the problem? I can manipulate the lines but I cannot add text.

    February 6th, 2008 Mark
  37. As everything I have encountered on the net abou the great CSS hype, errors poping up at all winds… I use WXP SP2, IE7 when I changed the size from 300(default) to 100… I get a warning things will be cut off…(Ok with that) but then, I get all these errors poping alerts! hmmmm! Is CSS ever clean and error proof???!!! I am begining to wonder how much idiocy can pile up in our browsers implementations! Thank you for the effort… the examples supplied are good for juggling one’s coding tribulations thru the pitfalls of the CSS/browser soup! Thank you.

    February 6th, 2008 NicMartel
  38. Good looking out! and great UI design also. Been sharing this with all the CSS Designers here at work. Keep up the good work.

    February 8th, 2008 Real Estate Postcards Dude
  39. Hey Mark,

    The system only does output the divs (or javascript). It’s independent of the text you are trying to wrap. You simply place the outputted code above the text you are wrapping.

    Take a look at the source code of this page for an example:
    http://csstextwrap.com/example_for_demo.php

    So it works like this (I removed > and < so that it wouldn’t get messed up in email)

    div
    [your generated code]
    [the content that you want to wrap]
    /div

    Hopefully that makes more sense!

    February 9th, 2008 Nate Weiner
  40. I need to know if your text wrapper can work with designs for t-shirts and banners
    using a arch or bridge (envelope) shape for the text to fit in and follow the shape of the envelope? Check out this website http://www.designashirt.com/custom-t-shirts/designashirt/515.html
    Let me know if you text wrapper will work

    February 12th, 2008 KURT FRANCIS
  41. Hey Kurt,

    The CSS text wrapper would not be very well suited for that type of function.  It generates code for websites and wouldn’t be able to actually transform lettering.

    I would suggest finding a flash developer to build an application for you.  A good place to do that is to post a job listing on craigslist.org.  It’s good and free!

    Thanks!

    February 12th, 2008 Nate Weiner
  42. when using safari - the generated code doesn’t include the container style nor the actual text being displayed.

    February 19th, 2008 mc
  43. MC

    That’s correct, you simply add the generated code above the actual text on your website.  The wrap code is independent of style/content.

    Watch the demo video for more information:
    http://csstextwrap.com/demo.php

    Thanks! 

    February 19th, 2008 Nate Weiner
  44. Sweet! I like how you have 3 options on how to do the code. Very flexible, very cool!

    March 15th, 2008 Will
  45. Works superbly in IE7 but having difficulty in FF. My page has a picture upper right (outside the containing div), and a picture bottom left (in the background). In FF the wrapping only starts below the upper image - anyone else had this problem?

    Thanks for a great tool.

    March 25th, 2008 kingtomatoby
  46. Hey kingtomatoby

    Can you provide a link to the example?  I can take a look and see if I know what’s up.

    Thanks! 

    March 26th, 2008 Nate Weiner
  47. The code generated by CSS Text Wrapper works great in Firefox, but in IE 7 the text doesn’t wrap correctly. After some testing I found that IE completely ignores the height property. It overrides it with the inherited text height. So, you have to set the text height (font-size:0px;) as well as the div height. Alternatively, you can use the code (overflow: hidden;). It’s still not perfect, but it looks much better.

    April 19th, 2008 Mark
  48. Works nice except after checking on a computer with higher resolution, the preferred shape was gone.

    April 20th, 2008 Patrick
  49. @Patrick
    The content area the wrap shape is in has to be a fixed width to work correctly. If the area expands with the window width it will break the desired shape.

    April 22nd, 2008 Nate Weiner
  50. I wish i can have more lines to create the wrap.
    For example, i wanna do the text with a W shape, but i can’t.
    Keep updating!

    April 28th, 2008 Beldar
  51. so when you type something like aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh it won’t wrap? how you fix that..

    April 29th, 2008 Mark
  52. Just the thing i was looking for to make life simpler. Thanks alot!

    May 28th, 2008 David Smith
  53. Excellent tool. Just the thing for a website redesign I’m working on. Only issue I have found thusfar, after tweaking to get it positioned right: it does not match up exactly in IE7 and FF (as mentioned previously by others). Otherwise, loving it. :)

    June 13th, 2008 Lily N.
  54. Excellent!!!!!!!!! Now . . . if only I could scroll the text up and down while still wrapping around the fixed images.

    July 24th, 2008 NancyL
  55. I know you guys really love the traffic you get due to this module, but could you make it downloadable? I am currently deployed to Iraq and would love to use this, but don’t have much time on the net (when I even get to use it).

    Please email me in response, seeing as I try to maximize the little time I have online. It would just be much more convenient for me. Thanks!

    August 1st, 2008 Enoctis
  56. @Enoctis

    There is no processing done on the server, if you download the entire page (with the javascript and flash file), everything should work normally on your own machine. You might have to play with the file paths though.

    August 1st, 2008 Nate Weiner
  57. I love this! Can’t wait to use it! I already have about a million ideas.

    August 27th, 2008 Badcrocodile
  58. Hey!

    Very nice piece of software! It isn’t that precise in it’s preview, but that isn’t really a problem since this kind of expirimental text-markup always requires a lot of tweaking and testing. But, because of that, It would be nice to be able to save your situation (the text u used, your settings and the lines you have drawend). This way people would be able to tweak if they found out a couple of days later that they made a mistake, without having to draw the lines again from scratch.

    August 28th, 2008 Erwin
  59. brilliant! thank you

    September 15th, 2008 carlo
  60. @Mark with the aaaa…: If you use PHP (for server-side processing) or JavaScript (for client-side processing), you could insert soft hyphens automatically in long words. You should also have a look at http://code.google.com/p/hyphenator/

    November 1st, 2008 herojoker

Leave a Reply