什么是& shy;以及我如何摆脱它 [英] What is ­ and how do i get rid of it
问题描述
我注意到,在查看页面源代码时,在< div>
标记之后显示的字符& shy;
.我仔细检查了编码,找不到源于何处.我做了一些研究,他们说是在那里,所以可以砍词.
I have noticed, while looking at my page source, the characters ­
showing just after a <div>
tag. I went trough my coding and can't find where it is from; I did some research and they are saying that it is there so words can be cut.
在< h1>
标记附近,我有一个浮动图像,它比标题大一点.我想知道这是否是造成这种情况的原因,因为由于图像浮动,我可以将标题扩展到第二行,但它仍然存在.
Near the <h1>
tag I have a floating image that is a little bit bigger than the title. I was wondering if that was causing it since I could extend the title on a second line because of the floating image but it remains.
我如何摆脱它?为什么在那儿?
How do I get rid of it? Why is it there?
来源如下:
<div class="container">
­
<img src="floating_right.png">
<h1>Title</h1>
<div class="more stuff"> eventually justified text</div>
</div>
有任何线索吗?
编辑
这是我的实际代码;
echo '<div id="inputTag">';
echo '<img id="winClose" class="btn_close" src="http://images/html/bouttons/fermer.png" alt="Fermer">';
echo '<h1>'.$titre.'</h1><br>';
我可能还会提到我正在使用Webmatrix 3.
I might also mention that I am using Webmatrix 3.
编辑
要解决此问题,我已经在Notepad ++中打开了文件,就在这里;
To fix this I have opened the file in Notepad++ and there it was;
echo '<div id="inputTag">-';
Voila!
推荐答案
此脚本将查找并删除页面上所有不可见的& shy;
:
This script will find and remove all the invisible ­
s on your page:
document.body.innerHTML=document.body.innerHTML.replace(/\u00AD/g, '');
通过搜索Unicode字符 U + 00AD
起作用.当它不在换行符处时,它是不可见的,这可能就是为什么在代码中找不到它的原因.
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.
这篇关于什么是& shy;以及我如何摆脱它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!