user2175191
user2175191

Reputation: 9

em dash in Internet Explorer 7

Does anyone know how to make the em dash appear in IE7?

I have tried to use the IE9.js file but it doesn't appear to work.

Anyone have any ideas?

Upvotes: -3

Views: 1067

Answers (3)

Marat Tanalin
Marat Tanalin

Reputation: 14123

For IE of versions older than 8, generate real elements via JavaScript and make them contain real content equivalent to content of :before/:after generated pseudoelement:

var example = document.getElementById('example'),
    span    = document.createElement('span');

span.innerHTML = '—'
example.appendChild(span);

And then attach the span element with same styles as your :before/:after generated pseudoelement.

By the way, consider dropping support for such ancient IE version as IE7. Actually, it's time to consider dropping support for IE8 already. ;-)

Upvotes: 0

thirdender
thirdender

Reputation: 3951

In CSS:

// Support IE7, which doesn't support :before pseudo selectors
*zoom: expression(
  function(t) {
    t.runtimeStyle['zoom'] = '1';
    t.innerHTML = "— " + t.innerHTML;
  }(this)
);

Upvotes: 0

doitlikejustin
doitlikejustin

Reputation: 6363

Why can't you just type it out?

In HTML:

— or —

And in CSS:

content:"\2014"

Upvotes: 3

Related Questions