treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Define a CSS property in the Meta tag

  • I was customising my Tumblr theme and found this:


    <meta name="color:Background" content="#E3E3E3" />
    <meta name="color:Top Border Color" content="#f9382d" />
    <meta name="color:Body Text" content="#373737" />
    <meta name="color:Link Color" content="#3e8fa0" />

    <meta name="color:Triangle One Color" content="#66a22c" />
    <meta name="color:Triangle Two Color" content="#ffdc24" />

    Then in the CSS:

    article h3 a span { color:{color:Top Border Color}; font-weight:bold; }


    Is the first time i see this and i wanted to share :) What are the pros of using this except not repeating the color more than once? Do you know who came up first with this idea?
  • i recently worked on a project where the programmer used php to declare the main colors and bits in the stylesheet. it was a lot easier to remember "header color" and "body text color" than #aiusdhfapiufa9w (<-- slight exaggeration, but you get the idea).
  • The PHP in CSS is quite easy as Chris kindly explained a few years back http://css-tricks.com/css-variables-with-php/

    The meta one is completely new on me!
  • This is ONLY for Tumblr.

    It's a way to allow users to set their own values for colors.