Remove the button, input default border, and focus line in IE6/7

Source: Internet
Author: User

1. Remove the border:

Look at the basic HTML:

<Div class = "Wrap"> <input type = "text" class = "input_txt"> <input type = "Submit" value = "Submit" class = "input_btn"> <input type = "button" value = "Submit" class = "input_btn"> <div>

Generally, the best way to solve such a bug is to add a tag outside the tag of the button and input, write the style on the tag, and remove the default styles of the button and input.
Method 1: Set CSS:

<Style type = "text/CSS"> input {margin: 0; padding: 0 ;}. wrap {background-color: #0f0 ;}. input_txt ,. input_btn {border: 0 none ;}</style>

Method 2: Set CSS and use a filter:

<! -- [If IE]> <style type = "text/CSS"> input {margin: 0; padding: 0; filter: chroma (color = #000000); Border: none ;}. wrap {background-color: #0f0 ;}</style> <! [Endif] -->

This method seems to be a problem! To be verified in the real IE7 environment.

2. Remove the focus line:

<Style type = "text/CSS"> A: focus, *: Focus {nofocusline: expression (this. onfocus = This. Blur () ;}</style>

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.