Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Media queries for each browser

Tags:

html

css

I want to resize my input field as per browser. can I write media query for each browser so separate width for input field on separate browser, like for mozilla it will have separate width on chrome and opera it will have separate width.

like image 421
Prasad Avatar asked Aug 28 '13 05:08

Prasad


2 Answers

Media queries are media queries, not browser queries. They are there to test certain properties of the viewport, device or display. There are no media features that let you test for a certain browser.

like image 133
Joey Avatar answered Oct 09 '22 08:10

Joey


If you want to do this you should be able to find something on browserhacks.com which has a bunch of code samples to explain how to get a browser with css media queries so for IE you might do something like this.

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {}

This works because the only browser that those rules will apply on is Internet explorer

like image 5
Aiden Grossman Avatar answered Oct 09 '22 08:10

Aiden Grossman