This is a solution to the Order summary card challenge on Frontend Mentor.
Users should be able to:
- See hover states for interactive elements
- Solution URL: https://github.com/effycoco/order-summary-frontendmentorchallenge
- Live Site URL: https://effycoco.github.io/order-summary-frontendmentorchallenge/
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- 制作卡片:不同背景色 + box-shadow
- 利用 flex 使多行字居中
<div class="container">
<div class="item">
<h1></h1>
<p></p>
</div>
</div>
.container {
display: flex;
align-items: center;
}
-
使用
overflow:hidden
处理圆角容器中的图片 -
CSS variables 用法
:root {
--pale-blue: hsl(225, 100%, 94%);
--bright-blue: hsl(245, 75%, 52%);
--very-pale-blue: hsl(225, 100%, 98%);
--desaturated-blue: hsl(224, 23%, 55%);
--dark-blue: hsl(223, 47%, 23%);
}
body {
background-color: var(--pale-blue);
}
- repsonsive design 原则:mobile first.
需多练习由宏观至微观、由外至内的布局思路