I’m displaying articles on a page. The article titles sometimes spill over onto two lines, and may even have only a single word on the second line. This is very undesirable. Using jQuery/CSS, what would be the best method to programmatically determine a new font-size for the titles to keep them on one line?
I’m displaying articles on a page. The article titles sometimes spill over onto two
Share
Kind of a hack but: Something like this will get you close. It likely needs a little more tweeking. Basically, it clones the element and sets the clone’s text to  , so it gets an idea of what the height of one line would be. Then it decreases the element’s font size until it’s smaller than the target height.
Keep in mind you would also need to attach this function to the parent’s resize().