0

At start, this is general question without sample code, as i'm looking for a idea, how to archive this:

I have 3 absolute positioned elements, which overlaps each other. They all have background color, for example red.

Now, div1 overlaps div2, so they have common area, and user is unable to see when first div ends, and secod starts...

As i draw on image below, i may chage opacity of this divs, so user can see some diffrence, but this may be not 100% good solution.

My question is, does anybody have ideas, how make this more readable, maybe some css features, which i don't know about (background color mixing or something...)

Thank you for ideas :)

enter image description here

2 Answers 2

1

You can set the opacity of a background color using rgba:

.div { background-color: rgba(255,0,0,0.8); }

This takes your red, green and blue colours then an opacity (from 0 to 1 in decimal form). You can also use opacity: 0.8 but it's going to lower the opacity of the entire div including its border.

Sign up to request clarification or add additional context in comments.

Comments

1

Another idea is not to use just transparent background color, but transparent lines and hashes, in different directions. A bit like in the below image.

But you could make the lines a bit transparent and in different angles and colors. This way, the difference in the divs will be more elegant. And not a mess of colors.

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.