Create a gist now

Instantly share code, notes, and snippets.

CSS_positionで要素の上下入れ替え(レスポンシブ)
section {
width: 80%;
height: auto;
position: relative;
margin: 60px auto 0;
}
img {
width: 100%;
height: auto;
}
div {
width: 100%;
height: auto;
position: absolute;
top: 0;
left: 0;
padding-top: 66.67%;
margin: 0;
}
h1 {
height: 50px;
line-height: 50px;
background-color: #333;
margin: 0;
}
p {
height: auto;
background-color: #ff0;
color: #000;
margin: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment