Created
June 11, 2020 13:09
-
-
Save agustinpfs/a1cb9e1337571555506158c07ce59acd to your computer and use it in GitHub Desktop.
CSS. Posisiones relativas, absolutas y fijas.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Positions</title> | |
<style> | |
.elemento { | |
background-color: coral; | |
border: 5px solid purple; | |
display: inline-block; | |
vertical-align: top; | |
width: 200px; | |
height: 200px; | |
} | |
.uno { | |
position: fixed; | |
top: 250px; | |
left:0; | |
} | |
.dos { | |
/* position: relative; | |
top: 50px; | |
left: 50px; */ | |
} | |
.tres { | |
/* position: relative; */ | |
} | |
.hijo { | |
background-color: cornflowerblue; | |
width: 100px; | |
height: 100px; | |
/* position: absolute; | |
bottom: 10px; | |
left: 10px; */ | |
} | |
</style> | |
</head> | |
<body> | |
<div class="elemento uno"><h2>elemento uno</h2></div> | |
<div class="elemento dos"><h2>elemento dos</h2></div> | |
<div class="elemento tres"> | |
<div class="hijo">hijo</div> | |
<h2>elemento tres</h2> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment