Is it possible to have a variable defined in the html page and called in an external css style page? I have
-----------html page --------------
@variables {
pageheight: 900px;
}
--------- css page -----------------
#left_container {
width: 375px;
height: var(pageheight)px;
float: left;
background-color: #c40b08;
position: absolute;
left: 0px;
top: 0px;
}
So the issue that i have is the page is divided into 2 columns. The left side red and the right white. The right side has the content is longer and the left side will always be shorter in used area. The red side needs to go to the bottom of each page always. If i just set it to what would need to be the max for all pages some they will be twice as long as necessary which i think looks bad. If the variable will work in the html page then i can set a length for each page. If the variable doesn't work in the html page is their anyway to accomplish what i need.
Just use JavaScript to
Just use JavaScript to overwrite the CSS property...
can you explain ... i don't
can you explain ... i don't know java?
bcyork wrote:can you explain
can you explain ... i don't know java?
O'reilly makes some really comprehensive books on the subject.
great for o'reilly ... that
great for o'reilly ... that doesn't really help
bcyork wrote:great for
great for o'reilly ... that doesn't really help
Hmm. They always help me. PHP is a better solution than javascript but why don't you just use faux columns instead of fooling around with variables in your css? That way you don't define the page height, you let the content do it.
The content isn't long
The content isn't long enough on the left which is where the red is to define it by content. faux columns????
bcyork wrote:The content
The content isn't long enough on the left which is where the red is to define it by content. faux columns????
Have you googled the phrase?????
Hugo wrote:bcyork wrote:The
The content isn't long enough on the left which is where the red is to define it by content. faux columns????
Have you googled the phrase?????
Hugo, Hugo, Hugo. Can't you see he want's you and I to do his work for him. He can't be bothered to read a book or google a phrase or look at a post called "Answer to 90% of the questions asked on this forum". Let's be realistic, ok?
Whups. Did I say that aloud? :blushing:
That was nice of me to provide the answer wasn't it? }:)
As you can see Sally, we don't spoon feed here. We'll point you in the right direction but then encourage you to find your own way so that you learn. Not only to be self sufficient but to be a real world problem solver. We'll guide you but we won't hold your hand. Not everyone's from chicago. :ohdear:
Hmmm, faux columns alone
Hmmm, faux columns alone won't necessarily do the job unless the background is on the body. If the body is already used for another image, then the wrapper or whatever would need to be 100% high...
so after googling css "faux columns" you will also want css "100% height model" in order to do this correctly.
IE does support "css javascript" which is mostly used to shore up IE6's CSS failings. I would otherwise advise against using Javscript to size pages-- min and max height and width in CSS can usually do the job better and with less bloat.
Otherwise, unfortunately CSS does not support real variables (although some wildcards are supported)... sometimes I wonder if it will in the future. Presentation and behaviour can have a pretty blurry line.
Stomme poes wrote:Hmmm, faux
Hmmm, faux columns alone won't necessarily do the job unless the background is on the body. If the body is already used for another image, then the wrapper or whatever would need to be 100% high...
so after googling css "faux columns" you will also want css "100% height model" in order to do this correctly.
If it's covered by a 100% height item then why can't it be on the body background? You're making it more complicated than it has to be.
IE does support "css javascript" which is mostly used to shore up IE6's CSS failings. I would otherwise advise against using Javscript to size pages-- min and max height and width in CSS can usually do the job better and with less bloat.
Are you speaking of "expression" property?
Otherwise, unfortunately CSS does not support real variables (although some wildcards are supported)... sometimes I wonder if it will in the future. Presentation and behaviour can have a pretty blurry line.
What are some good reasons for CSS to support variables?
Triumph wrote:What are some
What are some good reasons for CSS to support variables?
So you can easily change values like colours, fonts etc without having to search and replace.
Tyssen wrote:So you can
So you can easily change values like colours, fonts etc without having to search and replace.
What about forcing a page height?
Yeah I know that's what the
Yeah I know that's what the thread is about, but my answer was in direct response to your question: being able to change colours and fonts would be especially useful for things like stylesheet switchers or for styling different sections of sites with a different theme.
Tyssen wrote:Yeah I know
Yeah I know that's what the thread is about, but my answer was in direct response to your question: being able to change colours and fonts would be especially useful for things like stylesheet switchers or for styling different sections of sites with a different theme.
I know where you're coming from.
Quote:If it's covered by a
If it's covered by a 100% height item then why can't it be on the body background? You're making it more complicated than it has to be.
It's only if the body is already holding a background image and that image couldn't be moved to another element : ) But I sure do overcomplicate things, which conflicts with my inherent laziness at times...
Are you speaking of "expression" property?
Yup. I hate them but they've saved my butt quite a few times (mostly I'm a fan of flex-width pages).
What are some good reasons for CSS to support variables?
Kinda what Tyssen said-- I'd love to be able to describe things more broadly, I'd love to be able to use regular expressions, I'd love to be able to reference a parent via its children, I'd like a pony for Christmas...
A pony's for life, not just
A pony's for life, not just for Christmas.