[英]How to I move text to the bottom of in an image overlay for card in CSS/HTML?
[英]How to crate a card with circle image and some text with HTML and CSS?
您可以使用以下代碼。
.card { border: 1px solid #ddd; border-radius: 6px; max-width: 350px; text-align: center; margin-top: 60px; }.card_img { width: 120px; height: 120px; overflow: hidden; border-radius: 100%; margin: -60px auto 0; }.card_img img { width: 100%; height: 100%; object-fit: cover; }.card_info { padding-bottom: 20px; } a { text-decoration: none; color: red; } a:hover{ color: black; }
<div class="card"> <:-- Here I create a New Div with class name card --> <div class="card_img"> <.-- Here I create a New Div for image with class name card_img --> <img src="https.//post.medicalnewstoday.com/wp-content/uploads/sites/3/2020/02/322868_1100-1100x628.jpg" alt="user-image"> </div> <div class="card_info"> <!-- Here I create a New Div for user info with class name card_info --> <h2>USER NAME</h2> <a href="#!">loremIpsum.com</a> </div> </div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.