2
I have a div parent
and 4 div's child
and would like to change the color of border
of div parent
relative to the size of div child
. To exclaim better put down an image with an example of what I speak.
The pink and red colors are just to illustrate the size of the divs child
and the border on the left belongs to div parent
. I would like you to answer me at jquery
.
Edit:
Follow the requested code. It is the border
gray of div parent
I want to change the color with the size of your divs child
.
$(".timeline").css({
"border-left" : "5px solid lightgray",
"padding-left" : "10px"
}).children().css({
"margin-bottom" : "5px",
"padding" : "5px",
"border" : "2px solid black"
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="timeline">
<div>
<bold name="10 3 2017 9:10">Block 1 </bold>
</div>
<div>
<bold name="10 3 2017 10:30">Block 2 </bold>
</div>
<div>
<bold name="10 3 2017 12:30">Block 3 </bold>
</div>
<div>
<bold name="10 3 2017 13:50">Block 4 </bold>
</div>
</div>
Edit 2:
The second div starts then ends the margin.
Post the code if possible, it’s easier to help you.
– Bruno Romualdo
@Brunoromualdo edited the question and put the code.
– Bruno Gibellino
Just so you understand, you want them to change in
:hover
or which always have the colour of the border changed– Bruno Romualdo
Always, but only creates with the size of 1 div Child
– Bruno Gibellino
I understood, as an edge but separated from the right div?
– Bruno Romualdo
I’ll send you a Jsfiddle ;)
– Bruno Romualdo
Just one more question, why do you need the gray edge if it’s going to be covered?
– Bruno Romualdo
This is to make a kind of Timeline where I need the gray border for the said Timeline and I want it to be another color when the step is complete.
– Bruno Gibellino