Web Hosting, Design, & Coding forum

General discussion

Problem with hyphen in email address

by billyk53 / April 12, 2008 1:00 AM PDT

On my site, IE browser splits email addresses containing a hyphen into three lines
e.g. some-email@email.com displays as




How do I stop this from happening

For example, on this page


scroll down to the entry for Guiliano Villas and you will see the email address is broken into three lines. It displays ok in Firefox but not in IE

Discussion is locked
You are posting a reply to: Problem with hyphen in email address
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Problem with hyphen in email address
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Re: wrong display in IE
by Kees Bakker / April 12, 2008 5:13 AM PDT

This is the code for the whole info-block:

<div class="basic bas1"><div class="basicname">
Giuliano Villas S.L. </div>
<div class="basictel"> 966 470 865 </div>
<div class="basicaddress">
Av de Libertad 34, Edf Arenal 80 Loc 3, 03730 Javea
<div class="webad"> giuliano-villas.com </div>
<div class="email"> info@giuliano-villas.com </div>
</div> </div>

Please share the appropiate part of your css. That's at least the style you defined for the email class.


Collapse -
by billyk53 / April 13, 2008 9:45 PM PDT

The CSS is as follows

.basic {
position: relative;
float: left;
width: 98%;
font-weight: bold;
padding-left: 1em;

.basicname {
position: relative;
float: left;
width: 49%;
font-size: 1.1em;

.basictel {
position: relative;
float: left;
width: 15%;

.basicemail {
position: relative;
float: right;
/*width: 10%;*/
font-size: 90%;
height: 10px;
width: 25px;
padding-top: 0.2em;
padding-right: 0.2em;
margin: 0.2em;
text-align: center;

.basicemail a img{border: .04em solid blue;}

.bas1 {
background-color: #D4D4D4;

.basicaddress {
width: 95%;
text-align: left;
font-weight: normal;

float: left;
width: 45%;

Note that I do not think this is a space-allocation problem because it displays properly in Firefox.

Collapse -
by Kees Bakker / April 13, 2008 9:53 PM PDT
In reply to: CSS

The emailaddress is the only one that has a width in pixels. And 25 isn't really much for an emailaddress. Apparently Firefox doesn't mind at all, while IE uses the dash as a hyphenation character.

It's arguable which one is the more correct. It might be part of the freedom an 'agent' has according to the w3c-specs. I didn't research that.

Try changing 25 in 250 and see if that makes a difference.


Popular Forums

Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


Your favorite shows are back!

Don’t miss your dramas, sitcoms and reality shows. Find out when and where they’re airing!