loading..

loading, please wait...
Mohit Aneja a.k.a CSSJockey

CSSJockey.com

Hello! I am Mohit Aneja, Designer and Developer based in India.
I believe in creating a Unique & Practical Web Presence not just html pages.
If you need some cool stuff, let's talk :)

Snippets / HTML/CSS

New Webkit CSS Properties

There are several vendor specific prefixes and features depending on your browser. Webkit properties allows you to enhance the look of your web pages where possible. These properties change according to the browser where it is same in case of Safari and Google Chrome, because both are -webkit based web browser. However, to get it working in other browsers like Mozilla Firefox you have to use -moz property. There are several new addition to the existing list of proprietary of WebKit property. Let’s have a quick look on some new properties.

-webkit-user-drag
-webkit-user-drag property specifies whether an entire element should be draggable instead of its contents.

Syntax:

 -webkit-user-drag: auto | element | none; 

The default value of this syntax is set to auto, setting it to element will drag entire element instead of dragging its contents only and if you set it to none, any element cannot be dragged.

-webkit-appearance
This property allows you to change the appearance of any simple element like span to look alike button, checkout, list-item etc. There are approximately 50 appearance options available for this property. You may use it based on the following syntax:

Syntax:

 -webkit-appearance: <appearance>; 

-webkit-touch-callout
Using this property lets you disable a callout on -webkit enabled browsers.

Syntax:

 -webkit-touch-callout: default | none | inherit; 

For examples, on iPhone when you hold your finger on a link a popup comes with information of the link, you may disable that pop up using this property.

-webkit-user-select
The -webkit-user-select property prevents users from selecting any text within the specified element.

Syntax:

 -webkit-user-select: auto | none | text; 

It accepts three properties auto in which a user can select contents in the element, none which prevents user from selecting any element and text which lets user select text only.

Make sure that these properties will work only in webkit enabled browsers like Google Chrome and Safari. Properties above are very few from -webkit property family, there are still much more which gives you the freedom to enhance your web pages. Keep in mind that, these properties has nothing to do CSS2.1 or CSS3, these are browser specified prefixes which works different in different browsers. If you just came to know about any new -webkit property, share it!

You may also like to read..

4 Comments on New Webkit CSS Properties


  1. Apr 15, 2012 / Samiullah:
    I think we have to make a container draggable with javascript then -webkit-user-drag works. Reply
  2. Apr 15, 2012 / Samiullah:
    When you set {-webkit-user-select:text} it selects not only text but image too, than how it's said above that giving value text will select text only? Reply
    1. Apr 15, 2012 / Ram Ratan Maurya:
      Samiullah, you can say that its a technical bug or something. But whenever you select texts it also selects images or icons. May be we can see some improvement in near future as HTML5 is getting ready to rock the web. Reply
  3. Apr 08, 2012 / Rilwis:
    Thanks for your post. I haven't known about these properties, but it would be better if we have a demo. Reply

Leave a Reply

Stay up-to-date

Get latest tutorials and articles directly in your email.

Subscribe in RSS Reader

Connect via Facebook

Follow me on Twitter

Visit our Google+ Profile

Connect via Skype

I keep my Skype open all day long while I work on my computer.
Feel free to ping me to start conversation.

I love good conversations!!
If you have some big ideas, suggestions, feedback,
or want to discuss your project give me a shout.

 
%d bloggers like this: