What is ­ and how do i get rid of it

前端 未结 4 719
日久生厌
日久生厌 2021-02-10 00:25

I have noticed, while looking at my page source, the characters ­ showing just after a

tag. I went trough my coding and can\'t find
相关标签:
4条回答
  • 2021-02-10 00:33

    A quick Google search showed this:

    https://en.wikipedia.org/wiki/Soft_hyphen

    Basically, it's a - I think. I would recommend looking for a - on your web page. If you don't see one I wouldn't recommend bothering with it unless you wanna use jQuery and make a simple script that'll remove it.

    EDIT

    It seems you want to get rid of it. I'd recommend trying to move around your images and play with them a little until it goes away.

    0 讨论(0)
  • 2021-02-10 00:37

    This script will find and remove all the invisible ­s on your page:

    document.body.innerHTML=document.body.innerHTML.replace(/\u00AD/g, '');
    

    It works by searching for the Unicode character U+00AD. It's invisible when it doesn't sit at a line break, which is probably why you can't find it in your code.

    0 讨论(0)
  • 2021-02-10 00:40

    You can safely get rid of the tag in the example you have posted. ­ is known as the soft hyphen and is used to break words up across multiple lines in web pages. You would normally expect to see it in the middle of really long words in a paragraph the same as you would hyphenate a long word in a written paragraph to space it over two lines in case you run out of page as you write it.

    As for how to remove it, you can open the web page up using your website editor, locate the tag and simply delete it from the file as you would any other text on a web page when you edit the page normally.

    0 讨论(0)
  • 2021-02-10 00:42

    Soft hyphen (shy) This character is not rendered visibly; instead, it suggests a place where the browser might choose to break the word if necessary. In HTML, you can use ­ to insert a soft hyphen.

    0 讨论(0)
提交回复
热议问题