I take it this is as regards the textarea tag. If so, there's no good substitute for wrap. The closest css equivalent is (for wrap="off"):
Code:
white-space: nowrap;
However, perhaps until recently (I haven't checked this in the most recent browsers yet, I'm assuming that most of them now comply) not all the browsers see it that way. The older versions still abound though. In a couple of years maybe.
I don't think there are other types of wrap that one would need to be concerned about. The two others are hard/physical, and soft/virtual. These determine how the text is transmitted to the server. I'm unaware of any css equivalents for them. As they don't affect what the user sees, there probably aren't any. I believe the default is soft/virtual in most browsers. That means that unless the user hits the enter key while typing, no line break is sent when the data is submitted, but the text in the textarea will wrap visually to accommodate its dimensions. With hard/physical wrapping, the text wraps to accommodate the dimensions, and when sent to the server retains the line breaks as seen by the user in the textarea.
As for a DOCTYPE that would support wrap? I don't think any of the standards invoking DOCTYPES do.
This is one of those few cases where somethings just fall through the cracks.
However, as far as I know, wrap still works just fine. So you're left with the option of either using it and having that one glitch in your validation, or resorting to various workarounds. I'm thinking of wrap="off" here. But it would work with the other two kinds. You can have the textarea be written using javascript. If done - say with a document.write like so:
Code:
<script type="text/javascript">
/* <![CDATA[ */
document.write('Result: <textarea id="strNote" cols="50" rows="1" wrap="off" readonly><\/textarea><br>');
/* ]]> */
</script>
That will validate to HTML 4.01 strict.
Depending upon the objective one could substitute other elements and style them as I did for the code blocks on this page:
http://home.comcast.net/~jscheuer1/side/thecrawl/
They look like textareas, but they're not.
Bookmarks