Home
Services
Business Listings
Free Business Scan
Listings & Reviews Pricing
App Development
Blog
Contact
Search
Home
Services
Business Listings
Free Business Scan
Listings & Reviews Pricing
App Development
Blog
Contact
Blog
Blog
Techemistry Blog
Oh Silly Hyphen - Prevent Line Break on Hyphen
4/29/2013 7:27:00 PM
--
Ted Krapf
<p>Here's a cool thing I learned today. I had an issue where a customer's webpage contained a word that required a hyphen to be grammatically correct: pre-plated. The word pre-plated appeared at the end of a line in a set width column. Internet Explorer would render the word on two lines instead of one. This would also happen when zoom levels other than 100% were set in other browsers and/or when the responsive design would kick in.<br /> <br /> </p> <p>In other words, the sentence formatting should of looked like this:<br /> <br /> <br /> <strong>This is a cool sentence about things <br /> pre-plated and some things that are not.</strong></p> <p>When the problem occurred, the hyphenated word would get broken apart onto separate lines like this:</p> <p><strong><br /> This is a cool sentence about things pre-<br /> plated things and some things that are not.</strong></p> <p> I had read that there is a <nobr> tag, but it's not officially part of the HTML spec. So what's a guy to do?</p> <br /> <p><strong>CSS to the rescue!<br /> <br /> </strong></p> <p>If you simply code the html as, CSS will handle the dirty work:<br /> <br /> </p> <p><span style="white-space: nowrap;"> pre-plated</span><br /> <br /> </p> <p>Setting nowrap for white-space will prevent the browser from wrapping text at that particular point.<br /> <br /> <br /> Cheers! </p> <br /> <p><br /> </p>
[
return to articles list
]
Recent Articles
Daily Tip - Update AddRemoveProgramsIcon (and other properties) in a Visual Studio Installer Project
6/11/2019 8:35:00 PM
--
Ted Krapf
ZeroSSL with IIS 10
5/3/2019 5:11:00 PM
--
Ted Krapf
MinerGate.com Review - Mixed Emotions
2/3/2018 6:44:00 AM
--
Ted Krapf
Account Breach Monitoring
9/20/2017 3:36:00 PM
--
Ted Krapf
DBML Visualizer VERY Slow - solved!
3/29/2017 8:15:00 PM
--
Ted Krapf
Poor Man's SQL Log Shipping (Kinda)
12/23/2016 9:54:00 PM
--
Ted Krapf
Excel Column Letter To Number.com
4/8/2016 3:06:00 PM
--
Ted Krapf
Easy & Powerful Ecommerce Solution
4/5/2016 7:58:00 PM
--
Ted Krapf
asp:Menu Flicker on Page_Load - Solved
7/13/2015 1:48:00 PM
--
Ted Krapf
Offline ClickOnce app with command line parameters
3/9/2015 9:46:00 PM
--
Ted Krapf