开发者

HTML attribute value question

what does it mean a value that contains no U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) characters. Can some one explain in layman's terms and give an example?开发者_StackOverflow中文版


I guess it means a string that doesn't contain a line feed or carriage return character, like this_one.

here_is
one_that_
does

Update

I got this info from w3.org

Please link to this. I thought it may have been don't use them in your HTML attributes, but I just validated a page with a multiline title attribute with the W3C validator.


When you press Enter in a text editor to go to the next line, an invisible LINE FEED and/or CARRIAGE RETURN character is inserted.

Some HTML attributes cannot have any line breaks in their values, according to the specification,


That has nothing to do with HTML attributes or values. LF and CR are end of line characters. Wikipedia has an excellent article about them. What are you trying to accomplish and where are you getting this error?


In HTML, common commands will include an element, an attribute and a value. For example, in <A HREF ="somevalue"> A is the element, HREF is the attribute and somevalue is the value.

When you say values cannot have a carriage return or a line feed, then the value statement should not look like this:

<A HREF ="somevalue ENTER
somevalue continuing after a carriage return and line feed"></A>

Avoid that. Instead, that same information should be typed, letting the code wrap around on its own.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜