Web page making tips for using CSS to define styles in a FORM element

Source: Internet
Author: User
Tags define definition domain
css| Tips | Web page First look at the following code:

<body>
<form name= "Form1" >
<input type= ' file ' name= ' file1 ' id= ' file1 ' style= ' Display:none ' >
<input id= ' Text1 ' style= ' border:1 solid ' black;height:22 ' >
<input type= ' button ' value= ' file ' style= ' border:1 solid '
Onclick= ' Document.all.file1.click (); document.all ("Text1"). Value=document.all ("File1"). Value; ' >
<input type= "button" value= "Onclick= ' document.getElementById" ("File1"). Click () ' >
<input type= "button" value= ">"
</form>
</body>

This just know that the original file domain can also be defined by scripting! But Firefox doesn't support it.

So I wrote a little about the form of the definition of the style, carefully studied the following:

  1.form

First, the form has a boundary, a filler. Be sure to remember, or you will never find out where the problem is when you first start to learn.

2.input

Define the button is input when we can define its font color, border, background color. Only this definition of the word as if it is always not so vertically centered! But it doesn't affect the effect.

3.inputl Image beautification

When we want to beautify the button, we need to use the background, then note must not forget to define the border is none. Then you can define the pictures you like. Define its height and width. ※ When we write the value, be sure to write Chinese characters, and then define style text-indent:-9999px; so that you can hide the word, if it is English will be displayed, this situation is in IE, in Firefox does not exist in this situation, the other kind of feeling always if you value does not write values , in IE button on the very small, Firefox does not have this phenomenon. You can test yourself.

4. File domain

For a button that defines a file field, I divide the field into two parts, showing the text section A, button B, for easy clarity. We define the A,b border only, as well as part a background color, text color.

5. Text fields

This button, we can define the width, but the height is invalid. If you want to define a higher number can only define a larger font, such as the definition of a font size of 30px, then its height will increase accordingly.

The above discussion is not a script for the general situation. Let's write so much first.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.