Five tips for div css form layout can help you control the form more flexibly and make the page more satisfying.
1. Mobile selection for form text input:
In the text input field, if a prompt is added, visitors often have to use the mouse to select and delete it, and then enter useful information. In fact, as long as you add onMouseOver="this.focus()" onFocus="this.select()" code to <textarea>, everything will become much simpler, such as:
Example Source Code [www.devdao.com]< textarea name=textarea wrap=virtual rows=2 cols=22 onMouseOver="this.focus()" onFocus="this.select()">Input English..</textarea>
Similarly, you can add code to <input>.
2. Click to delete the form input unit:
This column has the same function as the above, but there is a slight change in using the mouse. You need to click instead of just covering it with the mouse like the above. For example:
Example Source Code [www.devdao.com]<input type=text name="address" size=19 value="Enter,e-mail..."onFocus="this.value=''">
After clicking the input unit, the prompt message will be deleted, isn't it very convenient?
3. Border settings of form input units:
Changing the traditional form unit borders will make your homepage more colorful. For example:
Example Source Code [www.devdao.com]<input type=radio name=action value=subscribe checked style="BORDER-BOTTOM: dashed 1px; BORDER-LEFT: dashed 1px; BORDER-RIGHT: dashed 1px; BORDER- TOP: dashed 1px;background-color: #FEF5C8">
Among them, "style=***" is the left, right, top, bottom and background color settings. It is applicable to other units. Readers are asked to try it themselves.
4. Text setting of form input unit:
The font of the unit in the form can be modified, such as:
Example Source Code [www.devdao.com]<input type=text name="address" size=19 value="Enter,e -mail..." style=font-family:"verdana";font-size:10px >
Among them, "style=***" is the font and font size settings.
5. Modify form properties to pop-up windows:
After most forms are activated, they will open in the current page, affecting normal browsing. It is better to modify it, such as:
Example Source Code [www.devdao.com]<form method=POST action=url target=_blank>
Among them, "target=_blank" controls the opening of the pop-up window.