Html: what effects do "shape" have on page layout
I thought that the html form does not affect the page layout and that it is just a way to group fields to send their values ββto the server on a single request.
However, I notice that when the form tag is removed, the layout changes.
Where can I find an explanation of the effects of the visual <form> tag?
source to share
<form>
is a block-level element, so at least it will appear on a separate line. It probably also has some basic default margin and padding attributes. I would recommend using Firebug to inspect the form element and see what those layout properties are.
You can easily customize the look <form>
through external css file, css in HEAD document, or inline styles on the form, for example:
<form style="margin: 0; padding: 0; background-color: #cc5500;">
...
</form>
source to share
The element form
is a block level element, so the element itself will have layout properties.
Different browsers have different default styles (margins, padding, etc.) for rendering controls. One way to get around this is using CSS resets like Eric Meyer's classic reset.css or a more styled CSS framework like Tripoli .
Note that form elements work great outside of the tag form
, for example they are used as interface controls.
While the W3C documentation isn't always easy to read, it is the final text in HTML. See Forms in HTML documents .
source to share