Using Angular 2, I was trying to partly show a cover image by using
img[md-card-image] {
hidden: overflow;
max-heigth: 160px;
}
However, Angular decides that it boxes the image inside during the overflow. I cannot seem to figure out how to get the image fill the whole top of the card.
Edit 1
If I do not use the above css, and instead change the div which wraps my cover image to margin-bottom: -50%;
which moves the text up on top of the image; however, in this case, I cannot set a background to the content on the card. for the part of the text that runs over the image.
After days of trying different things, I finally came up with a solution. I had to remove the
md-card-image
and manually do it with divs. I guess the material design css is messing with it causing the issue when you add thehidden: overflow
to the container.Here's what it looks like:
My styling for the material card:
The html for the material card: