SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Barefoot on the Moon! silver trophy
    Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,528
    Mentioned
    52 Post(s)
    Tagged
    1 Thread(s)

    input[type="text"] & IE6?

    Is there a standard workaround for using this in IE6?

    Code:
    form input[type="text"], form textarea, form select {
    	border: 1px solid #3b6e22;
    }
    form input[type="radio"], form input[type="checkbox"] {
    	margin-right: 3px;
    	margin-left: 3px;
    }
    If I use the input type selector, it isn't recognized by IE6. If I add a class to the element in the HTML, and add it to the selected elements in CSS, it ignores that as well

    Code:
    form input.myclass, form input[type="text"], form textarea, form select {
    	border: 1px solid #3b6e22;
    }
    Although, it seems to work when I do this:
    Code:
    form input.myclass{
    	border: 1px solid #3b6e22;
    }
    form input[type="text"], form textarea, form select {
    	border: 1px solid #3b6e22;
    }

    However, I'd like to avoid doing that if I could, so I don't have to maintain the same code in two places.

    Is there any standard workaround that you usually use?

    Thanks

  2. #2
    SitePoint Addict chestertondevelopment's Avatar
    Join Date
    Dec 2005
    Location
    Essex, UK
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I haven't tried it but what about putting the "form input.myclass" bit after the "form input[type="text"]" part? I'm sure I've had to do something similar in the past. e.g.
    Code:
    form input[type="text"], form textarea, form select, form input.myclass {
    	border: 1px solid #3b6e22;
    }

  3. #3
    Barefoot on the Moon! silver trophy
    Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,528
    Mentioned
    52 Post(s)
    Tagged
    1 Thread(s)
    Nope, didn't work.

    After some digging, the more common solution seems to be to just refer to input types by specified classes, rather than attribute selectors, since attribute selectors aren't supported in IE6


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •