CSS example (II): flexible use of input Elements

Source: Internet
Author: User

During web development, there is often a special input element in the Information entry interface, such as: required field, date selection field, and field selected value in the pop-up window, using CSS to set the appearance of these elements saves unnecessary buttons and prompts to make the page more concise.
The effect is as follows:

To achieve this effect, you only need one image:

CSS code is simple: HTML code

  1. <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <HTML xmlns = "http://www.w3.org/1999/xhtml" XML: lang = "ZH-CN" dir = "LTR">
  3. <Head>
  4. <Title> old Wang-CSS technology website next door </title>
  5. </Head>
  6. <Style type = "text/CSS">
  7. . Input1,. input2,. input3 {
  8. Padding: 0;
  9. Height: 15px;
  10. Line-Height: 15px;
  11. Border: 1px solid # abaffb;
  12. Background: url(inputbk.gif) No-repeat right 0;
  13. Width: 300px;
  14. }
  15. . Input2 {
  16. Background-position: Right-15px;
  17. }
  18. . Input3 {
  19. Background-position: Right-30px;
  20. Background-repeat: Repeat-X;
  21. }
  22. </Style>
  23. <Body>
  24. <H2> Use CSS flexibly to control the appearance of input elements. <br/> unnecessary buttons and prompts are skipped. </H2>
  25. <Input class = "input3" value = "use CSS flexibly, required field"/> </br> </BR>
  26. <Input class = "input1" value = "wallimn"/> </br> </BR>
  27. <Input class = "input2" value = "http://wallimn.iteye.com"/>
  28. </Body>
  29. </Html>

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.