File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes CSS question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "CSS question" Watch "CSS question" New topic

CSS question

Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239

as you can see, I need to declare div#myDiv over and over again. is it possible to do something like this:
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858


[Asking smart questions] [About Bear] [Books by Bear]
Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 299
Not in CSS but you can do something like that using sass and scss. But it is not CSS, you have to compile your files and they will generate a css for you.
Rob Crowther
Ranch Hand

Joined: Nov 06, 2012
Posts: 297

One day it will be possible one way or another in 'raw' CSS, but it's not finalized and no current browser support.

Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
I agree. Here's the link:
subject: CSS question
jQuery in Action, 3rd edition