I have div parent
and 4 div's child
and would like to change the color of border
of div parent
relative to div child
size. To exclarge better put below an image with an example of what I speak.
Thepinkandredcolorsarejustforexamplethesizeofdivschild
andtheborderontheleftbelongstodivparent
.Iwouldliketobeansweredinjquery
.
Edit:
Followtherequestedcode.Itistheborder
grayofdivparent
thatIwanttochangethecolorwiththesizeofitsdivschild
.
$(".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><divclass="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>