-3

I use

display:-moz-box

Its work on firefox truly but "invalid property value" on chrome, what should i do now?
Thanks

user2676574
  • 17
  • 1
  • 6
  • That is a prefix specifically for Gecko - you'll need to also include the WebKit version - `display: -webkit-flex` – Adrift Aug 15 '13 at 15:29
  • possible duplicate of [Flexible box model - display : flex, box, flexbox?](http://stackoverflow.com/questions/15662578/flexible-box-model-display-flex-box-flexbox) – cimmanon Aug 15 '13 at 15:32

3 Answers3

2

Any CSS code that starts with a hyphen is a browser-specific feature (it also often means the feature is experimental and not yet ready for a full release).

Only the browser that uses that extension (-moz- is for Firefox) will work with that property. Other browsers may need their own prefix specified instead (eg -webkit- for Webkit-based browsers, or -ms- for IE).

You should also specify the unprefixed version of the style if it has been standardised, as the experimental prefix is likely to be removed from future browser versions once the standard version is established.

In this particular case, we are talking about the flexbox feature. There has been quite a bit of change to the specs for this over time as it has gone through the standardisation process, so some browsers may support non-standard syntax. This makes it slightly harder to give a succinct answer here, so rather than go into great detail, I'll point you to some articles that may help:

Spudley
  • 166,037
  • 39
  • 233
  • 307
  • +1 mate, I did read somewhere that it is always best to add the standard one (without any prefix) as the last. Is that correct? – Harry Aug 15 '13 at 15:43
  • 2
    Yes that is correct, take a look at: http://emps.l-c-n.com/notebook/css-vendor-prefixes-and-the-cascade (I would upvote the answer but ran out of them :() – Adrift Aug 15 '13 at 15:48
0

use display:-webkit-boxfor chrome

Saint
  • 480
  • 1
  • 6
  • 21
0

-moz- is a vendor prefix. Vendor prefixes are unique to the browser. They are used to apply non-standard CSS. -moz- is for Mozilla Firefox. -webkit- is for chrome.

twinlakes
  • 9,438
  • 6
  • 31
  • 42
  • 1
    moz is actually for gecko and webkit is for webkit, they are not unique to browser's but unique to rendering engines, f.e. webkit is also used by safari – koningdavid Aug 15 '13 at 15:32