Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7558655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:25:33+00:00 2026-05-30T12:25:33+00:00

This CSS expression P { background-color: expression((new Date()).getHours()%2 ? #B8D4FF : #F08A00); } can

  • 0

This CSS expression

P {
   background-color: expression((new Date()).getHours()%2 ? "#B8D4FF" : "#F08A00");
} 

can be called thousands of times

but this approach, means

<style>
P {
   background-color:expression(altBgColor(this));
}
</style>
<script type="text/javascript">
function altBgColor(elem) {
    elem.style.background = new Date()).getHours()%2 ? "#B8D4FF" : "#F08A00";
}
</script>

means it won’t. Why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:25:34+00:00Added an answer on May 30, 2026 at 12:25 pm

    What did you expect to happen?

    The very first time your dynamic expression is called it overwrites the background property which contained that expression.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this CSS code: h1 { font-size:22px; color:#341C12; font-weight:normal; font-style:italic; } .h1color h1{
I have this CSS style that does a rounded corners for div border, but
I'm trying to find out if a string contains css code with this expression:
I have such an inline CSS like this color:#777;font-size:16px;font-weight:bold;left:214px;position:relative;top:70px The CSS may end with
I know this has been asked a million times, but I haven't had much
outline-style: none; margin: 0px; padding: 2px; background-color: #eff0f8; color: #3b3a39; font-family: Georgia,'Times New Roman',Times,serif;
This seems a little silly to ask but some background: I'm a designer who
.newEventItem .eventDateInfo .eventVenue { display: block; color: #CCC; overflow: hidden; height: expression(this.scrollHeight > 27
how can I hack CSS for IE6 and IE7 in same expression?? (if posible,
Inside my CSS, I put: .someClass { width: literal(expression(this.width > 40 ? 40: true));

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.