CSS styling of form tags
css, html, styling, web
Solution
As far as I am aware, a `<form></form>` tag is supposed to be invisible as part of a webpage
It is supposed to represent a form. That is definitely visible thing
and that when designing a form, one should use div tags (or equivalent) to represent the physical form structure.
`<div>` is the tag of last resort. Use it when something more suitable (like `<form>` or `<fieldset>`) does not exist.
Is it acceptable (according to W3C standards) to apply CSS to a `<form></form>` tag?
Baring bugs in browsers, it is acceptable to style any element in the document.
and can anyone point me in the right direction for literature on this issue?
Since there is nothing special about the element, it does not need specific documentation.
The closest I can think of is this warning from the CSS 2.1 specification:
Note. CSS gives so much power to the "class" attribute, that authors could conceivably design their own "document language" based on elements with almost no associated presentation (such as DIV and SPAN in HTML) and assigning style information through the "class" attribute. Authors should avoid this practice since the structural elements of a document language often have recognized and accepted meanings and author-defined classes may not.
… but relating that to the question is a stretch since you are suggesting using semantic markup, but adding unnecessary divs purely for styling.
Problem
As far as I am aware, a `<form></form>` tag is supposed to be invisible as part of a webpage, and that when designing a form, one should use div tags (or equivalent) to represent the physical form structure. Is it acceptable (according to W3C standards) to apply CSS to a `<form></form>` tag? and can anyone point me in the right direction for literature on this issue?