This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes CSS depending variables Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "CSS depending variables" Watch "CSS depending variables" New topic
Author

CSS depending variables

manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308
hi,

is it possible to do this somehow in CSS:

#bla{
width: 500px;
}

.center-of-bla{
margin-left: #bla.width/2; //pseudo-code
}

thank you.


aldana software engineering blog & .more
manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308
one question more i forgot to ask:

is it possible to put the align flag of <div align="center> into as CSS statement so it is possible to just write <div class="align-center">?
or is it impossible to outsource attributes of the <div>-tag?

thanks again.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
Well you can search google for "CSS expression" and you can see how IE would allow you to do it.

and I think you are looking for text-align: center;

Eric
manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308
well i think i will definetely not use proprietary extensions. thanks anyway.

what about my 2nd question: putting this align="center" attribute into a css-class? is that possible?

thanks again!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: CSS depending variables
 
Similar Threads
Dynamically changing class attribute of TD without Scriptlet
Wrapping of select box
consistent font size across the project?
Centering a column heading in a datatable
Display jsp based on user agent