Jump to content

CSS property question...


ahschmidt

Recommended Posts

Hi all, I apologize that the subject of this post isn't more detailed. I am looking at a sample of CSS that I am a bit confused by:

.shadowBoxHover {     -moz-box-shadow: 3px 3px 4px #000;     -webkit-box-shadow: 3px 3px 4px #000;     box-shadow: 3px 3px 4px #000; }

I have never seen the bits like '-moz-box-shadow' before. Is this a CSS3 thing? Thanks for any info that you can provide!

Link to comment
Share on other sites

Sometimes browsers add special CSS properties that only they have, or (as in this case) they add a property that is part of a future specification (CSS3) before the specification is complete or widely supported. Properties beginning with - are the kind I'm talking about. -moz properties belong to Mozilla (Firefox and a few others) and -webkit belong to Safari and Chrome. In time, browsers will discontinue those properties and use only the official properties.

Link to comment
Share on other sites

In time, browsers will discontinue those properties and use only the official properties.
<rant target='_browserVendors'>I really don't understand why they use the prefixes in the first place. Just makes it all the more confusing for the developer. It's rather irritating. Come on, the spec is going to eventually be supported anyway so why not just use the real property name instead creating all this confusion. :) And if for some reason that property is never included in the spec then they can just drop support for it or keep it as a proprietary property.</rant>
Link to comment
Share on other sites

Right on, thanks for the info! I had figured that the -moz was a Mozilla reference which caused a bit more confusion.I can honestly understand why there are these WIP names for these properties, at least until they are made standard. It creates some responsibility for these properties while they are being developed. This can also help devs determine why this property isn't working in browser X, especially those who may not realize that these are in development. The tricky bit is down the road when these properties are replaced, and there is still mark up out there using these old property names. Will there be legacy support for these names? Will it cause confusion for new developers in 5 years?

Link to comment
Share on other sites

It creates some responsibility for these properties while they are being developed.
You have a point there. However, I believe it is a developers (new and experienced ones) responsibility to know and learn the properties that are standardized. If they are unfamiliar with a property it is their responsibility to look it up. Any good reference site will tell you what browsers support which properties.
The tricky bit is down the road when these properties are replaced, and there is still mark up out there using these old property names. Will there be legacy support for these names? Will it cause confusion for new developers in 5 years?
Indeed.Will there be legacy support? I would imagine there would have to be some level of legacy support otherwise countless sites could be left broken. Then again, having legacy support leaves the table open for developers to use the old vendor-specific properties, which would produce invalid, extraneous, and unnecessary markup.Will it cause confusion down the road? Almost certainly. Some developer happens across a -moz or -webkit property that doesn't seem to do anything in any browser and wonders what on earth its purpose is.All the more reason for browser vendors to ditch those blasted prefixes....
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...