ok na po kaso yun kulay Violet naman hindi sumunod sa agos makikita sa picture po
html code :
<div class="events">
<ul>
<li class=" time-container" id="time-container">
<div class="time">
<h2>May <br>1<span><br>2023</span></h2>
</div>
<div class="details" id="details1">
<h3>Title</h3>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Facere, voluptates reprehenderit officia quaerat numquam expedita temporibus, consequatur dolorem dolorum, necessitatibus et id doloremque incidunt explicabo maiores tempora veritatis quae eos?</p>
</div>
</li>
<li>
</ul>
</div>
<script>
var details = document.getElementsByClassName('details');
for (var i = 0; i < details.length; i++); {
var content = details.querySelector('p');
var height = content.offsetHeight;
details.style.height = height + 'px';
}
</script>
css code :
section .events {
position: relative;
width: 60%;
height: 100%;
background: rgb(88, 88, 88);
float: right;
box-sizing: border-box;
}
section .events ul {
position: relative;
top: 2%;
transform: translateY(-50%);
margin: 0;
box-sizing: border-box;
}
section .events ul li {
list-style: none;
background: #fff;
box-sizing: border-box;
height: 180px;
float: left;
}
section .events ul li .time {
position: relative;
padding: 20px;
background: rgb(96, 6, 212);
box-sizing: border-box;
width:25% ;
height: 100%;
float: left;
text-align: center;
transition: .5s;
}
section .events ul li:hover .time{
background: red;
}
section .events ul li .time h2{
position: absolute;
margin: 0;
padding: 0;
top:50%;
left: 50%;
transform: translate(-50%,-50%);
}
section .events ul li .details {
padding: 20px;
background: #fff;
box-sizing: border-box;
width: 75%;
float: left;
}
html code :
<div class="events">
<ul>
<li class=" time-container" id="time-container">
<div class="time">
<h2>May <br>1<span><br>2023</span></h2>
</div>
<div class="details" id="details1">
<h3>Title</h3>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Facere, voluptates reprehenderit officia quaerat numquam expedita temporibus, consequatur dolorem dolorum, necessitatibus et id doloremque incidunt explicabo maiores tempora veritatis quae eos?</p>
</div>
</li>
<li>
</ul>
</div>
<script>
var details = document.getElementsByClassName('details');
for (var i = 0; i < details.length; i++); {
var content = details.querySelector('p');
var height = content.offsetHeight;
details.style.height = height + 'px';
}
</script>
css code :
section .events {
position: relative;
width: 60%;
height: 100%;
background: rgb(88, 88, 88);
float: right;
box-sizing: border-box;
}
section .events ul {
position: relative;
top: 2%;
transform: translateY(-50%);
margin: 0;
box-sizing: border-box;
}
section .events ul li {
list-style: none;
background: #fff;
box-sizing: border-box;
height: 180px;
float: left;
}
section .events ul li .time {
position: relative;
padding: 20px;
background: rgb(96, 6, 212);
box-sizing: border-box;
width:25% ;
height: 100%;
float: left;
text-align: center;
transition: .5s;
}
section .events ul li:hover .time{
background: red;
}
section .events ul li .time h2{
position: absolute;
margin: 0;
padding: 0;
top:50%;
left: 50%;
transform: translate(-50%,-50%);
}
section .events ul li .details {
padding: 20px;
background: #fff;
box-sizing: border-box;
width: 75%;
float: left;
}
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.