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 3400052
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:50:44+00:00 2026-05-18T04:50:44+00:00

I have a list of divs, each with a ‘createdDate’ attribute, I evaluate each

  • 0

I have a list of divs, each with a ‘createdDate’ attribute, I evaluate each div’s createdDate,
I add another attribute ‘isNew’ , if it is less than 7 days old set true, false otherwise.

The css has:

div[isNew=true] div.title{ background:red } 

intending to set the background red when is less than 7 days.

using firebug and ie Dev tools – shows the background as set red, by the matching rule.

The browser is not displaying the title div in red though.

is there a way to nudge the css evaluation to redraw? or a better way?

  • 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-18T04:50:44+00:00Added an answer on May 18, 2026 at 4:50 am

    Since this snippet http://jsfiddle.net/fcalderan/Gh7Ud/ works as expected I would suggest to check markup and remaining css rules, probably you redefine after that style somewhere

    Note: your code requires an attribute ‘isNew‘: if you are in control of html code, it’s better if you make it future-proof changing it as ‘data-isNew‘

    As suggested by Zlatev, creating a class ‘ad hoc’ it’s another solution and this will ensure crossbrowsing, because oldest browser doesn’t recognize the CSS attribute selector. BTW I only suggest to not use a .red class because it would be too much bound to the element style (what if you change the colour?), so it’s better preferring a semantic class, like .newtitle

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

Sidebar

Related Questions

I have a list of Divs within another div and I want to only
I have a list of divs with onclick actions associated with them. Inside each
Say I have a list of divs identified by class .e.g '.myclass' Inside each
I have a list with 200 divs, <div id=sId_1 class=sDiv></div> <div id=sId_2 class=sDiv></div> ....
I have a list of div on a parent function, each does a onclick
I have three unordered list each surrounded by a container div (An example is
I have some data wrapped in 3 divs, each div represents a 'tab', and
I have a list of elements (divs) preseded by a H3 tag <h3></h3> <div
I have a list of divs (div.row), which I need to update the background-color
I have a list of 8 divs and need to add a sequence of

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.