This is my first time trying to really focus on including classes for all elements and giving them some kind of structure that links back to the parent div. Am I heading in the right direction with this?
Also, while I got there eventually, was there a more straightforward way to achieve the semi-transparent hover layer on the main image?
@nickfwilliams, your use of the ::before pseudo-element is probably one of the better methods to achieve the hover effect. It's compact and can be easily applied to other elements without having to modify HTML markup. Good job!
You just about have it with the box-shadow attribute, however the <blur-radius> value of the shadow is set to 0, which explains why the shadow edges look hard.
Going from
{ box-shadow: 028px016pxrgb(000 / 8%) }
to
{ box-shadow: 028px16px16pxrgb(000 / 8%) }
should move you closer to the result you're after. Check out MDN Box Shadow Values for details.
One solution for dealing with the position of the avatar img is to make it an absolute positioned element, and then set its bottom position to bottom:-48px, which is negative half the height of the image. This will center the image on the bottom edge of the upper-card element.
position:relative will also need be added to the upper-card element to insure the position of the image is based on its parent container.
Finally, add enough padding to the next element, middle-card, to compensate for the overlap of the image into this element's container. padding-top:50px should do the trick.
In this one, I have struggled with the buttons. I can't align the three of them to the same level because of the paragraph's different heights. Is there any CSS rule that can help with this?
It looks fine on the screenshot, but if you go to the link, it doesn't:
https://outerpreneur.github.io/3-column-preview-card-component-main/
Hi Joy, I have a suggestion regarding the the company logos.
Using display:flex for the element containing the logos forces each <img> to have identical width and height values, which explains why some of the logos look squashed (most noticeable on the Microsoft and Vector Graphics logos).
A quick solution for this would be to remove the display:flex property and space the <img> using margins, such as margin: 0 2%. This will allow each image to be uniformly scaled and remove the squashed look. The text-align:center property ensures that the images are centered within the page.
I have a vanilla JS & CSS example for creating a flip card animation. I started writing it here but it got a little wordy, so I created a CodePen instead. You can check it out here Flip Card With CSS and JS.
I hope it can provide some inspiration.