This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60794


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

Joined: Apr 08, 2009
Posts: 298
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: 295

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
Similar Threads
HTML content not displayed properly in JSF page
JSTL vs DOM generated HTML Table
Rotation of text
Multipart request problem
how to set multpile style classes for headerClass attribute in datatable???