建站學院(LieHuo.Net)網頁教程 大家都知道,在超級鏈接的title中需要換行的地方,加入如下字符 (回車鍵,)或著 (換行鍵,即)即可。
如下面的代碼,點運行查看效果:
建站學院(liehuo.net)提示:可修改部分代碼后運行!
那么這種方法是不是在所有瀏覽器都可以呢?經過測試,這種方法只能夠在ie(或者chrome)里面,firefox不買賬,網上搜索了,發現w3c的對于title的規范如下:
以下為引用的內容:
The (X)HTML DTDs define the contents of the title attribute as CDATA for which the W3C states:
User agents should interpret attribute values as follows:
- Replace character entities with characters,
- Ignore line feeds,
- Replace each carriage return or tab with a single space.
也就是說,title里面只能夠存在普通字符,能夠變成標簽的都成為普通字符,去掉換行符號,將回車符號變成空格,而firefox遵循這個w3c原則,所以在firefox里面沒有辦法通過這么簡單的方法來實現換行了。