I want to set individul card button on the bottom of div but also all card item title will be single or dubble line also
I want to set individul card button on the bottom of div but also all card item title will be single or dubble line also but i cant do that properly
<div className='w-full lg:w-1/4 bg-white rounded-xl p-6'>
<h2 className='text-blue-500 text-lg font-bold leading-7 mb-4'>
Credit Hour Remaining 7 hr
</h2>
<hr className='border-[#1C1B1B33] mb-4' />
<h2 className='text-[#1C1B1B] text-xl font-bold'>Course Name</h2>
<ul className='my-5'>
{selectedCourses.map((course, ind) => {
return (
<li key={course.course_id}>
{ind + 1} {course.course_title}
</li>
);
})}
</ul>
<hr className='border-[#1C1B1B33]' />
<h3 className='my-5 text-[#1C1B1BCC] text-4 font-medium'>
Total Credit Hour : {13}
</h3>
<hr className='border-[#1C1B1B33] mb-4' />
<h3 className=' text-[#1C1B1BCC] text-4 font-medium'>
Total Price : 48000 USD
</h3>
</div>
2
Answers
The code provided is different from the screenshot, anyway I suggest two ways one on the button and other for description.
Button: use
mt-auto
to set an auto top margin.Description: use
h-auto
to force the height push the button to the bottom.As the others said, the code that you provided is not related to what you want on the screenshots.
However, if you want to "stick" the buttons on the bottom of each card, you just need to wrap the content, except the button, in a div and add some classes.
You can check the code here: https://play.tailwindcss.com/MHbcPAeMsU?layout=horizontal