-3
A
回答
1
撥弄
https://jsfiddle.net/Hastig/n3w0tztv/
獲取圓圈留垂直居中,並具有文本容器最小高度圓的高度是棘手的且在此實例中沒有制定出。一個便宜的修補程序是在@media的斷點處添加align-items: center
到.container
。
body {
display: flex;
justify-content: center;
align-items: center;
margin: 0;
background-color: white;
height: 100vh;
}
.container {
display: flex;
width: 100%;
padding: 10px;
overflow: hidden;
}
.left {
position: relative;
display: flex;
width: 150px;
height: 150px;
margin-top: -4px;
margin-bottom: -4px;
margin-right: -17px;
background-color: #ec847c;;
border-style: solid;
border-color: white;
border-width: 4px;
border-radius: 100%;
z-index: 10;
}
.right {
position: relative;
display: flex;
flex: 2;
font-size: 20px;
color: white;
background-color: #4ca132;
}
.square {
position: absolute;
left: 0;
width: 50px;
height: 50px;
background-color: white;
overflow: hidden;
}
.square-top { top: 0; }
.square-btm { bottom: 0; }
.square::before {
content: "";
position: absolute;
display: flex;
width: 100%;
height: 100%;
transform: rotate(45deg) scale(2);
background-color: #4ca132;
z-index: 1;
}
.square-top::before { top: 50%; left: 50%; }
.square-btm::before { bottom: 50%; left: 50%; }
.text {
position: relative;
z-index: 2;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
padding: 20px 20px 20px 40px;
}
<div class="container">
<div class="left">
</div>
<div class="right">
<div class="square square-top"></div>
<div class="square square-btm"></div>
<div class="text">
Roles play an extremely important part in family funtion.
</div>
</div>
</div>
相關問題
- 1. 保持重疊的圓圈
- 2. MATLAB:區域重疊的圓圈
- 3. 在MATLAB中刪除重疊的圓圈
- 4. 與複選框重疊的css文本
- 5. CSS li.before彩色框中的圓圈就像li文本
- 6. NSTimer和重疊圈
- 7. 圓圈鍵CSS
- 8. CSS A圓圈和發光
- 9. CSS文本重疊
- 10. 防止拖動圓圈重疊
- 11. 如何加入重疊圓圈?
- 12. 背景中無邊框的透明重疊圓圈
- 13. CSS:重疊元素圓角
- 14. CSS中的文本重疊
- 15. 圓圈圖像疊加
- 16. 由重疊圓圈構成的區域和周長
- 17. 在圓圈內添加文本並在圓圈中添加小標題(HTML/CSS)
- 18. 文本和標籤在CSS圓圈中央
- 19. 沿D3圓圈包裝佈局中的圓圈的文本
- 20. CSS中的圓圈交點
- 21. WPF文本框和標籤重疊
- 22. CSS圓與內圈和圖像
- 23. 用css和jquery圓圈動畫
- 24. CSS圓圈和線條 - 連接器
- 25. 如何在CSS中製作大圓圈內的圓圈以及所有圓圈中心內的文字?
- 26. 圓角的邊框 - 文本輸入CSS
- 27. 文本框重疊標籤
- 28. 文本框下拉重疊
- 29. 用css圍繞圓圈文字
- 30. 與CSS重疊的邊框
圖像不工作,你需要發佈一些代碼。 –