Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7617861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:15:08+00:00 2026-05-31T03:15:08+00:00

It seems that even when using shivs you can’t do something like input[type=search] to

  • 0

It seems that even when using shivs you can’t do something like input[type="search"] to style the new HTML5 input elements in IE7. You can see an example at http://jsfiddle.net/2tmAp/ (view it in IE7 modes of course).

Presumably IE7 is setting these elements to type="text" and even though the DOM itself is staying the same this still somehow prevents the styles from applying.

What would be the neatest way to fix this? Is there something we can do in Javascript to trick IE7 into applying the styles the same way as shivs work on elements?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:15:10+00:00Added an answer on May 31, 2026 at 3:15 am

    The shiv is just a way to force-create the new elements regardless if supported or not. but addressing the type and attributes it a different thing, as well as the selectors. the fallbacks for the new "inputs" are the type "text". this goes for the search, datepicker, and others (can’t keep track of the new ones).

    There are two keys to understanding why the automatic fallback works consistently in all major browsers:

    • The default type for input elements is "text".
    • All browsers ignore unknown attributes.

    The consequence of these two points is that if you say <input type="foo" bar="baz"/>, all browsers will treat this identically to <input type="text"/> (unless "foo" is a recognized input type or "bar" is a recognized attribute of the input element).

    since type="search" is unknown to IE7, it falls back to type="text" and you can’t pick it up in CSS as type="search" since it’s now type="text"

    to address your selector issue, you can try using selectivizr which uses JS libraries’ abilities to do selector matching cross-browser (even in non-supporting browsers using a some pseudo-selector matching script). i don’t know if they pick-up shiv-created elements though.

    or better, use the usual way to create a searchbox in HTML/JS as a fallback,


    for an easy answer, i’d do what the other guy commented. Just create a class named "search" and apply this class name to all your search boxes. style them just the same as the one you used the selector with, just like:

    input[type="search"],input.search{
        /*styles*/
    }
    
    <input type="search" class="search" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seems that even after unchecking the option in the PyDev/Debug preferenecs pane to launch
It seems that C# 3 hit me without me even noticing, could you guys
It seems that ComboBoxes loose their selected item after their dataProvider updates, even if
Seems that requirements on safety do not seem to like systems that use AI
It seems that anyone can snoop on incoming/outgoing .NET web service SOAP messages just
jquery attaches a click method on even things that aren't typically clickable like a
It seems that i'm missing something trivial. Anyway, here it goes: var order =
We all know that the assembly can be queried for attributes using the GetCustomAttributes
When I'm accessing GMail inbox using POP3 protocol, it seems that after fetching given
Using the Amazon API it seems that it's not possible anymore to get the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.