Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Problem with hyphen in email address

Apr 12, 2008 1:00AM PDT

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

some

-

email@email.com

How do I stop this from happening

For example, on this page

http://www.estateagentsespana.com/costablanca/javea_estate_agents_01.htm

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

- Collapse -
Re: wrong display in IE
Apr 12, 2008 5:13AM 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
<br>
<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.

Kees

- Collapse -
CSS
Apr 13, 2008 9:45PM PDT

The CSS is as follows

.basic {
position: relative;
float: left;
width: 98%;
margin:0;
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;
}

.webad
{
float: left;
width: 45%;
}

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

- Collapse -
Re:CSS
Apr 13, 2008 9:53PM PDT

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.

Kees