Last active
April 20, 2023 05:51
-
-
Save jrichardsz/9aa9671807d520fa206c8dc00599938a to your computer and use it in GitHub Desktop.
html snippets
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> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
* { | |
box-sizing: border-box; | |
} | |
/*https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_two_columns*/ | |
/* Create two equal columns that floats next to each other */ | |
.column { | |
float: left; | |
width: 50%; | |
padding: 10px; | |
height: 300px; /* Should be removed. Only for demonstration */ | |
} | |
/* Clear floats after the columns */ | |
.row:after { | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
</style> | |
</head> | |
<body> | |
<h2>Two Equal Columns</h2> | |
<div class="row"> | |
<div class="column" style="background-color:#aaa;"> | |
<h2>Column 1</h2> | |
<p>Some text..</p> | |
</div> | |
<div class="column" style="background-color:#bbb;"> | |
<h2>Column 2</h2> | |
<p>Some text..</p> | |
</div> | |
</div> | |
</body> | |
</html> |
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> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body { | |
font-family: Arial; | |
color: white; | |
} | |
.split { | |
height: 100%; | |
width: 50%; | |
position: fixed; | |
z-index: 1; | |
top: 0; | |
overflow-x: hidden; | |
padding-top: 20px; | |
} | |
.left { | |
left: 0; | |
background-color: #111; | |
} | |
.right { | |
right: 0; | |
} | |
.centered { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
text-align: center; | |
} | |
.centered img { | |
width: 150px; | |
border-radius: 50%; | |
} | |
#parent { | |
background: #999; | |
padding: 10px; | |
} | |
.child { | |
background: #ccc; | |
height: 42vh; | |
margin: 10px; | |
} | |
.refresh { | |
margin: 10px;width: 97%; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="split left"> | |
<div id="parent"> | |
<div class="child"> | |
</div> | |
<div class="child"> | |
</div> | |
<button class="refresh" type="button">Refresh</button> | |
</div> | |
</div> | |
<div class="split right"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment