For those attributes that can stretch into infinity and beyond off-screen and do not tolerate white space like urls.
-
3Not possible. Did you consider getting a wider screen?Frédéric Hamidi– Frédéric Hamidi2010-10-05 22:27:20 +00:00Commented Oct 5, 2010 at 22:27
-
4enable line wrapping on your text editor?djrsargent– djrsargent2010-10-05 22:30:14 +00:00Commented Oct 5, 2010 at 22:30
-
@djrsargent, I cannot find line wrapping in netbeans 6.8.Geoffrey– Geoffrey2010-10-05 23:02:42 +00:00Commented Oct 5, 2010 at 23:02
-
@Frederic, 23 in. I will accept your comment as the answer.Geoffrey– Geoffrey2010-10-05 23:03:56 +00:00Commented Oct 5, 2010 at 23:03
-
you can't 'accept' a comment as an answer, please ask @Frédéric to post his comment as an anwswer to allow you to accept it, or accept an existing answer at some point.David Thomas– David Thomas2010-10-06 00:24:41 +00:00Commented Oct 6, 2010 at 0:24
2 Answers
There is nothing to stop you breaking attribute lists or attribute values over multiple lines.
<div class="thing"
title="Foo,
bar,
bof
"
>
zot
</div>
XHTML 1.0 section C.5 recommends avoiding attribute value newlines for legacy browser support reasons, but the browsers that got this wrong are long gone now.
However note that whilst some browsers will treat newlines in an attribute value as actual newlines, others will convert them to plain spaces.
Comments
Without knowing exactly what your question refers to, it's hard to say; but it's worth pointing out that html is more or less insensitive to white-space, so
<img src="path/to/image.png" height="200px" width="400px" class="title" id="mainTitle" onClick="alert('clicked')" style="display: block; float: right; position: relative;" />
is equivalent to
<img
src="path/to/image.png"
height="200px"
width="400px"
class="title"
id="mainTitle"
onClick="alert('clicked')"
style="display: block; float: right; position: relative;" />
I'm not wholly certain that it's possible, or valid, to separate the attribute/value pairs across lines, but certainly each pairing can be separated from the next/previous pair.
Incidentally, even Notepad allows for line-wrapping (under 'edit' or 'view', I'm not sure which since I switched to Linux full-time a few years back).