In many ways, the real forms of the main tools of the Web, but that does not mean that it should be clear. Using CSS was dominant, it could be done to change the way forms and elements of the form seen on the web. To standardize the size of the text field between the PC and Macintosh is a problem because the different operating systems interpret the wide range nature, the size of the fields can vary from browser to browser.
CSS form design offers the designer greater flexibility, bothto integrate and isolate the elements of shape and form. Text fields can accept, for example, on a shaded background color or a Web site has the same font used on the page. You can also draw attention to the form itself, giving a contrasting background design, which allows you to format a drop down the list for easy reading.
The synthesis of form
The form tag is an element that includes, as the div tag that is rendered by default. Both labels can be named in placewith CSS - you can also place a form on the page via CSS declarations. Browser support varies for some of the more esoteric CSS properties applied to the form tag, but the most common attributes such as background color and borders are drawn correctly, in most cases. Best of all, if CSS does not support certain attributes, these attributes are simply ignored, and makes clear the form.
Often, a Web page contains only a single form. In these situations, the style tag form itself isthe desired results. For example, this CSS rule is the entire shape of an orange background and a blue border:
Form (
background: # FF9900;
border: thin solid # 0000FF;
padding: 10px;
)
Padding is added to move the items in the shape of the edges. If your site is more of a shape and style you want one of each in a different way, create a CSS ID selector for each module. In this case, select the Advanced selection in the New CSS Rule dialog box and entering aUnique ID - such as the shape or form # # TopForm form below - in the range selector. The ID of the day as when you use this method.
Modify data
One way in which the form and div tags are different in terms of CSS is inheritance in question. Elements in a form not inherit the CSS properties of the form, but in a div element does not inherit days, div CSS attributes. It is necessary therefore to take a different path styling for all text fields in a certain form. Thebest way to contribute elements of form all at once at the original tag style. You may recall that the input tag is used to create text boxes, radio buttons, check boxes and Submit button.
For example, this CSS rule is all the elements of entry of a uniform background color and a specific color, font and size for text fields:
input (
background-color: # F5F5F5;
color: # 660099;
font: 10px Verdana, Arial, Helvetica, sans-serif;
)
CSS Text StylesThe fields for the original text and the text entered.
Tip: Note that a text box is actually a different name than the textarea-field line of text. You must create a CSS rule for the input and textarea tags.
One of the best applications for CSS and text boxes, set the width. This method is much more flexible and react with the field Char width of the window to inspect the properties for each text box. It is better to set the width of a CSS classInstead of directly change the CSS rule for the input tag. Why? Setting the width not only affects all single-line text fields, but also check boxes and radio buttons - also changed the input tag. According to the CSS rule is defined, set the class of a text field selected from the Property inspector.
The lists of distinction and menus
The select list / menu object is composed of two selected labels, and the option. The select tag is the container for the full list of items that useSelect the day for the width, style and font size for all the drop-down lists on the page in a uniform manner. The individual items in the list, a class that are called to separate tags option. Although this operation must be done by hand and is a bit 'boring, is the door to many opportunities.
If you have a very long drop down list, who ordered includes a wide range of categories, with clever CSS Styling may main category headings in color and are in sub --another.
Changing labels and legends
A form is more of a set of text boxes and check boxes, labels have an equally important role for the type of organization and ease of use. Labels module also apply to one of two ways. The standard technique for most of the labels in a column in a table with form elements to another location. Designers are increasingly on the tag label as a means to improve accessibility. Methodology Dreamweaver CSSfor any route in labeling of forms.
In a situation where all the labels are arranged in a column in the table, it is better to create a CSS class for your labels, and for the td tags. The most effective way to do this, first choose the column containing the labels and then select the desired class from the Style list on the Property inspector. Dreamweaver is the class selected for each cell in column li.
If yourLayout using CSS tags Label control is even easier. Add a CSS style specific to the tag label for a consistent look for all labels. Notice that still may need to adjust the size of that column label by setting the width in CSS for the tag label has no effect.
Two forms related fieldset tag - and legend - are available for style sheets. As noted in this section in the sidebar, "described Grouping Form Controls", which are both used togethercombine visual elements to form. The style of the fieldset tag to the limit established for modifying or adding space from the edge of the border. Change the style of Legend, if you want to give its background color and / or border.
Emphasizing Focus
Want a spotlight on the interaction of a module? CSS has a pseudo-element selector (so called because it is valid only if an element is in a particular state), the effect, if an element of form is selected. The CSSSelector is concentration, and works with the input, select, and textarea tags.
To create one: the switch of focus, follow these steps:
1. Select new CSS rule by CSS Styles panel.
2. In the New CSS Rule dialog box, select the Advanced selector.
3. Enter the name of influence followed the day: focus in the selector field. For example, if you wanted all the text boxes, radio buttons, check boxes and buttons to change when they get attention, make a contribution: concentrate.
4.Click OK to close the dialog box and open the New CSS Rule Definition dialog box CSS rule.
5. Select the desired style from the various categories and click OK when finished.
Preview the page in a compatible browser such as Mozilla Firefox, Netscape 6 or higher, Safari, and so on, to learn the CSS modifications.
Note: Unfortunately, the selector: focus is not supported in any version of Internet Explorer, as this was written. However, you can simulate the effect of inducingJavaScript functions with the onFocus () and onBlur () event, which manipulate the class attributes.
ไม่มีความคิดเห็น:
แสดงความคิดเห็น