简体   繁体   English

CSS/bootstrap:制作带有徽标和曲线图像的卡片

[英]CSS/bootstrap: make a card with logo and curved image

I want to make this design in CSS or bootstrap.我想在 CSS 或引导程序中进行此设计。 我想做的事

So I want a logo on left and image and text on right as seen in image.所以我想在左边有一个标志,在右边有一个图像和文字,如图所示。

 .card { box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); transition: 0.3s; border-radius: 10px; margin: 10px auto; }.grid-container { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px;; padding: 10px; overflow: auto; }.grid-item { margin: 5px; text-align: center; cursor: pointer; }.logo { width: 80px; height: 80px; position: relative; top: 10px; }.title { position: relative; top: 50%; color: white; }.img { height: 100px; width: 100%; border-top-left-radius: 40%; } @media screen and (max-width: 768px) {.grid-container { grid-template-columns: 1fr; } } }
 <div class="grid-container"> <div class="grid-item card"> <a> <.--code here--> <div class="row"> <div class="col-4"> <img src="assets/images/logo.png" alt="logo" class="logo" /> </div> <div class="col-8"> < --<h4 class="title">Watch It</h4>--> <img src="assets/images/banners/help-support png" alt="image" class="img" /> </div> </div> </a> </div> </div>

And the result looks like this:结果如下所示: 在此处输入图像描述

the problem is in the image curve;问题出在图像曲线上; I can't make it as it looks in first image.我无法做到,因为它在第一张图片中看起来。 Also when I add a title (I commented it above in html) and try to center it in the second image, the second image is shifted downwards.此外,当我添加一个标题(我在上面的 html 中对其进行了评论)并尝试将其置于第二张图片的中心时,第二张图片会向下移动。 : 添加标题使图像移位

Simplest solution would be to get an svg with shape of that curve and absolutely position it inside the col-8 div.最简单的解决方案是获得具有该曲线形状的 svg 并且绝对 position 它位于 col-8 div 内。 Add another class name along with it, if you go for that solution.如果您为该解决方案添加 go,请添加另一个 class 名称。

To make it work with just html and css would lead to unnecessarily complicated layout要使其仅与 html 和 ZC7A62​​8CBA22E28EB17B5F5C6AE2A266AZ 一起使用会导致不必要的复杂布局

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM