Skip to content

Instantly share code, notes, and snippets.

@PKTseng
Last active April 7, 2020 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PKTseng/8c6e8d9ca83b0896224921b41e2668d1 to your computer and use it in GitHub Desktop.
Save PKTseng/8c6e8d9ca83b0896224921b41e2668d1 to your computer and use it in GitHub Desktop.
index
.container {
width: 500px;
background: #0099ff;
margin: 0 auto;
}
.container .item {
background: #00ffa2;
color: #d32a2a;
text-align: center;
font-size: 36px;
margin-bottom: 10px;
}
.container .item1 {
height: 150px;
width: 150px;
}
.container .item2 {
height: 200px;
width: auto;
//因為沒設定寬度,所以會自適應延伸父元素,
//父元素寬多少ex:500px,子元素寬就會多少ex:500px
}
.container .item3 {
height: auto;
width: 400px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment