Can the label tags for attribute be associated with a normal div?

Not according to the spec: Some elements, not all of them form-associated, are categorized as labelable elements. These are elements that can be associated with a label element. “button” “input” (if the type attribute is not in the hidden state) “keygen” “meter” “output” “progress” “select” “textarea” http://www.w3.org/TR/html5/forms.html#category-label See also: The for attribute may be specified … Read more

Using Vim as an HTML editor

I do all of my HTML editing in vim. The three plugins I find most helpful for editing HTML and XML in vim are matchit, surround, and allml. Matchit will allow you to jump to the start/end tag with ‘%’. Surround allows you to easily add, delete, and change the surrounding tags. Allml provides you … Read more

Can div with contenteditable=true be passed through form?

Using HTML5, how do I use contenteditable fields in a form submission? Content Editable does not work as a form element. Only javascript can allow it to work. EDIT: In response to your comment… This should work. <script> function getContent(){ document.getElementById(“my-textarea”).value = document.getElementById(“my-content”).innerHTML; } </script> <div id=”my-content” contenteditable=”true”><a href=”https://stackoverflow.com/questions/7355583/page.html”>Some</a> Text</div> <form action=”some-page.php” onsubmit=”return getContent()”> <textarea … Read more

Why does overflow hidden stop floating elements escaping their container?

It creates a block formatting context. Block formatting contexts are important for the positioning (see float) and clearing (see clear) of floats. The rules for positioning and clearing of floats apply only to things within the same block formatting context. Floats do not affect the layout of things in other block formatting contexts, and clear … Read more

HTML comments within comments?

I think the key point is this: Note that comments are markup. http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4 This is not valid markup: <div <span/> /> … so neither is the one you mention. Since all my sites are written in PHP I normally comment out code with PHP comments: <?/*?> <div>…</div> <p>…</p> <?*/?> Perhaps you can use a similar … Read more