0

I have this style inside a PHP file that is applied to an Element

line-height: 120px;
display: list-item;
display: -moz-inline;
list-style: none;

I want that if browser is Chrome then display:list-item and if it is Mozilla then display: inline

The above style works well in Chrome, but in Mozilla it is applied as display: list-item

Umair Ayub
  • 19,358
  • 14
  • 72
  • 146
  • What you want to do? It´s way to the hell... Do you have problem in any browsers with any value? – pavel Oct 14 '14 at 06:26
  • Actually the above style is for `a` tag and on top of `a` there are images. I need to align those images vertically in middle – Umair Ayub Oct 14 '14 at 06:29
  • http://css-tricks.com/snippets/css/css-hacks-targeting-firefox/ maybe this could help.... – sinisake Oct 14 '14 at 06:31
  • @Umair There is no display `-moz-inline` property, the valid properties are `-moz-inline-box`, `-moz-inline-stack` and `-moz-inline-grid`. – Anonymous Oct 14 '14 at 06:33
  • @Umair: Can you show us your HTML and show how t should looks? Using styles for different browsers can work now, not in the future. – pavel Oct 14 '14 at 06:38
  • @Umair like that demo? - http://jsfiddle.net/038n6kL7/ – Anonymous Oct 14 '14 at 06:51

1 Answers1

0

How to apply specific CSS rules to Chrome only?

Here's a bunch of methods, that actually can help you. Just set style for mozilla and then overwrite it by the Chrome hack. But abstracting from that solution: maybe show us some bigger part of code (or even jsfiddle) so we can help you style it properly without any hacks.

Community
  • 1
  • 1
MRSoft
  • 77
  • 3