Non classic responsive Card component #1914
Unanswered
Georgeshermann
asked this question in
Help
Replies: 1 comment 1 reply
-
Hi, From what I can see you where most of the way there. Take note of the way the HTML is structured. I find it easy to imagine everything as boxes and determine what goes inside of which one for layouts. Maybe try drawing them on paper first to always have a reference. With practice this will get easier. I didn´t like the way the the image is limited in my example maybe try using just plain old CSS for the square, but I tried with tailwind in the example <div class="flex justify-center items-center bg-gray-100 h-screen">
<div class="px-6 py-4 flex max-w-xl space-x-4 bg-white rounded-md shadow-lg">
<div class="max-w-xs">
<div class="w-56 h-full">
<img class="h-full object-cover" src="https://images.unsplash.com/photo-1533147670608-2a2f9775d3a4?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=3150&q=80" alt="Sunset in the mountains"></img>
</div>
</div>
<div class="flex-grow flex flex-col space-y-2">
<h3 class="font-bold text-xl text-orange-500">Title of the events</h3>
<p class="flex-grow text-gray-700 text-base">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.</p>
<div class="flex justify-end">
<span class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2">#tag1</span>
<span class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2">#tag2</span>
<span class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700">#tag3</span>
</div>
</div>
</div>
</div> hope this was helpful! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey ! I'm trying hard (I'm a newbie in webdev) to make this card look like the photo

for small screens (mobile phone etc). I've spent the whole day on this and I still can't find an answer. Can someone help me please ?
PS : I don't care about the sharing and "love" icons, I just want my image and my text to have the same kind of layout.
``
Beta Was this translation helpful? Give feedback.
All reactions