- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi everyone,
I have a page with a list of records “dynamic content” what i want to know if is possible to change the css style for the newest on the list, but just for today or for the week, but tomorrow or next week those records will get back to the original css style automatically, and how I can achieve that.
If someone can give me a clue I’ll really appreciate
Thanks in advanced.
`:first-of-type` or `:first-child`
`:first-child` has better browser support for IE.
Thank you chrisburton,
:first-child will do the work for the last added, but what if I add 15 new records on the list today, I want all 15 to be different color til tomorrow.
Thanks again.
Then you’ll need javascript
JS will only work if you can somehow detect the date the records are added (must be outputted in the html, or in JS). Alternatively, you can use back-end languages like PHP to add a class to those new records.
I agree with @CrocoDillon PHP is the best way to go about it.