替代href,可能没有<a>

时间:2017-01-30 00:05:37

标签: html css

Edit: This question doesn't make sense, and my actual problem was that I had an tag inside another tag.

I'm in a scenario where it seems like I cannot use tags for links. Is there any JavaScript alternative, that functions the same way?

I have a string of text, and I have parts of that string which I want to have as links. This string has a fixed width of 200px, and needs the CSS overflow: ellipsis (Thus it should not wrap)

JSfiddle: https://jsfiddle.net/LzL9cv00/4/

1 个答案:

答案 0 :(得分:0)

这是您创建链接的方式。

   <p>
      So here we got <a href="#">Link1</a> and <a href="#">Link2</a>!
    </p>

建议更改:

https://jsfiddle.net/LzL9cv00/6/