*
The moose likes HTML, CSS and JavaScript and the fly likes CSS depending variables 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 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: 15376
    
    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!
 
GeeCON Prague 2014
 
subject: CSS depending variables