I have a problem, I want to put some border after each row but I dont know how to do this, could you help me please (without add 26 div)
.events {
display: grid;
grid-template-rows: repeat(26, 30px);
border-radius: 5px;
background: var(--calBgColor);
}
<div class="day mon">
<div class="date">
<p class="date-num">9</p>
<p class="date-day">Mon</p>
</div>
<div class="events">
<a href="http://google.com" class="event start-2 end-5 securities">
<p class="title">Securities Regulation</p>
<p class="time">2 PM - 5 PM</p>
</a>
</div>
</div>
and I want this (with black line) :
thanks guys
2
Answers
Well, adding border in your case you can use
border-bottom
property, but since you’re using the.events
class to define the grid rows, you might want to apply the border to the child elements of.events
, but again since you don’t want to add 26 divs, good approach would be targeting children of the.events
class, your mentioned HTML structure is showing that each event is contained within an<a>
tag, which is again inside the.events
div
, I’d do it like this:Also, this assumes that each row in your grid corresponds to an
<a>
tag.When I have personally coded these before I do include the individual divs due to the amount of content placed in, but this is exactly what you aren’t asking for though.
If you are looking for a simple solution and you have a fixed height for each day/using absolute for your events (which appears you are), you could use a background image of the dotted lines.
bg image for hosting