I have the following Layout:
<!doctype html>
<html lang="en">
<head>
<style>
html{
font-family: "Trebuchet MS", Helvetica, sans-serif;
color: white;
}
.outer{
/*Maybe something here?*/
}
.inner_1{
background-color: aquamarine;
display: inline-block;
width: 400px; /*(For testing)*/
}
.inner_2{
background-color: mediumaquamarine;
display: inline-block;
width: 400px; /*For testing*/
}
/*or Something like this?*/
/*inner_1:below{
background-color:red;
}*/
</style>
</head>
<body>
<div class="outer">
<div class="inner_1">
<p>This is inner_1. Some Content goes here</p>
</div>
<div class="inner_2">
<p>This should be red if it is <b>below</b> inner_1</p>
</div>
</div>
</body>
</html>
Is there a pure CSS way to select the second div
only if it is below the first div
? (Which is the case when the viewport-size drops below 800-ish px)
I want to apply color (or any CSS attribute) to the second div only if its below the first div.
I know I could use media-queries to put one div below the other and aplly styles to it but I don't know how much content will be in the div's so thats not an option.
Any ideas? please let me know.
EDIT I'm talking about visual representation.