CSS change child colors based on math? - css

Alright, I'll admit that title seems a bit cryptic, but here's the situation:
I have a list of actors on a page with photos and short bios, each one is its own <div>. Let's say that I have seven actors on my page, and I want the text colors in their boxes to change, say, to create a rainbow, so actor 1 would be red, 2 would be orange, 3 would be yellow, and so on. Can I do this without having to manually specify style="color:rgb(whatever)" on every div? Let's say I want the color values to change dynamically if I add more people to the list or take them away, so I'd specify a beginning color value of rgb(255,0,0) for red and and end value of rgb(255,0,255) for violet and somehow fill in the rest, so that each subsequent box has a different text color but all together they make a rainbow.
...or would I be forced to use JavaScript to do this?

No you need not required to red color manually you can use CSS nth-child selectors please check below tutorial
Click here!

Related

Highlight image regions on hover with CSS

What is the HTML CSS solution for highlighting specific areas of a map/floor plan like this?
http://www.centrecourtshopping.co.uk/store-info/
They use sprite image look here.
Basically, it works like that:
The map with dark-blue regions is completely static.
There is invisible layer on top of it made from small rectangular in their case <a> -- each corresponds to single dark-blue region and posses its its own id.
When cursor is placed over a rectangular with id x the sprite image is nicely aligned with its background (by setting CSS's background-position).
Do not think, this magic would be possible without using JavaScript.

label background and foreground change Unexpectedly

In my web applicaton I have some div that contain labels, when I click on a label it's foreground become blue and background become white.how can I prevent that?
I would avoid disabling user select colours. I don't know about other people but I often select text on websites, not because I want to copy it but because I am struggling to read it and selecting text is by far the easiest way to change the colour of text against it's background. I even sometimes do it with black text on a white background.

list of all available CSS colors (for the background)

I am writing some tiny javascript where in essence the content of a input text value is used to set the backgroundColor of a div
div.style.backgroundColor = inputText.value;
The page might look like this:
Color: [black]
DIV
Because people might mispell the color I want to change it to a combobox.
The question is how do I know the list of all available colors ?
e.g. orange, cyan,blue,aqua are standard
but blueaqua is not
You can see the complete list at w3c
http://www.w3.org/TR/css3-color/

How do i show a country map and make cities separate by changing color of mouseover

How do i show a country map and make cities separate by changing color of mouseover
I need an Idea how to do it like www.mudah.my site.
Basically how they (http://www.mudah.my/) do is by having 1 normal map image with no country highlighted (actually it looks like they use a couple images but make it like 1 image by placing a transparent div over the top of them).
They have a standard image map applied to this '1' image to define the separate areas and when the user mouses over a relevant part of the map they display a specify section of the highlight image (http://www.mudah.my/img/map_highlight.png) in a specific place on top the the existing image, but behind the 1 main transparent div. Presumably so the links associated with the image map) continues to work.
Hope this helps.

Create a grey box background within an Ax 2009 report

I always seem to be having fun working with the Ax 2009 product until I have to touch the now deprecated reporting tool. Today I've been asked to highlight some column titles and a totals area with a grey or shaded background. The *tutorial_ColourLines* report isn't what I need as we do not want to colour the whole report section. We only want to change the background color for labels or better yet, inside a shape.
Thanks
Revisiting the TrucosAx.com link in Spanish I posted in the questions comments, I've obtained an imperfect way of producing the silver backgrounds.
Create a Text object but makes sure it is behind all of the other controls, by moving it up the list of objects in the report section.
Set the new object as having the same dimensions and position as our original column title or label.
Change the original column title background colour.
Change the foreground and background colour of our new text object as well.
Fill the text object's Text property with garbage: OOOOOOOOOOOOOOOOOOOOOOOOOOO etc.
Any better suggestion is most welcome.

Resources