After a bit of searching for a truncation helper for HTML, I found this great gem: truncate_html. It maintains the HTML tags (i.e doesn't strip them out) and supports word boundaries. Nice! Oh, and supports Rails 2.x and 3.x.
Blog
Monday, December 6, 2010
Monday, September 13, 2010
Basic HTML Template for Designers to create a Style Guide
When I start a new front-end project coding HTML/CSS I will ask the designer to provide a style guide to outline the typography used through the website. I find when I mark-up the CSS for the typography first, before starting the grid, the overall CSS is cleaner. How do you communicate what elements need to be in the style guide? Well there are some basic elements such as headers, forms and table that I provide in a HTML file that the designer can start with. Then additional typography elements, such as typography in sidebars and call-to-actions are added to the style guide. Are there any elements you think need to be included in my basic HTML file? I like to keep it relatively simple so I don't add things like definition lists, but perhaps I should. Let me know.
Monday, November 16, 2009
Ask for help: background-image disappears on Internet Explorer 7 when in a div with float
I came across a strange CSS bug with IE 7 today. When I have a container that is floating and I use a text replacement technique the image does not show. Remove the float and it does. Or alternatively remove the DocType and it also works.
Browsing the 'net I haven't managed to find this bug. Have you come across this before? Do you have an explanation?