-
-
Notifications
You must be signed in to change notification settings - Fork 128
Add HTML #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HTML #44
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
[ | ||
{ | ||
"language": "html", | ||
"categoryName": "Basic Layouts", | ||
"snippets": [ | ||
{ | ||
"title": "Sticky Header-Footer Layout", | ||
"description": "Full-height layout with sticky header and footer, using modern viewport units and flexbox.", | ||
"code": [ | ||
"<!DOCTYPE html>", | ||
"<html style=\"margin: 0\">", | ||
" <head></head>", | ||
" <body>", | ||
" <div class=\"header\">header</div>", | ||
" <div class=\"body\">body/content</div>", | ||
" <div class=\"footer\">footer</div>", | ||
" </body>", | ||
" <style type=\"text/css\">", | ||
|
||
" body {", | ||
" margin: 0;", | ||
" display: flex;", | ||
" flex-direction: column;", | ||
" min-height: 100svh; /* Smallest viewport height */", | ||
" min-height: 100vh; /* Standard viewport height */", | ||
" min-height: 100dvh; /* Dynamic viewport height */", | ||
" min-height: 100lvh; /* Largest viewport height */", | ||
" background-color: red;", | ||
" }", | ||
"", | ||
" .header {", | ||
" position: sticky;", | ||
" top: 0;", | ||
" left: 0;", | ||
" right: 0;", | ||
" background-color: blue;", | ||
" }", | ||
"", | ||
" .body {", | ||
" flex-grow: 1;", | ||
" background-color: whitesmoke;", | ||
" }", | ||
"", | ||
" .footer {", | ||
" position: sticky;", | ||
" bottom: 0;", | ||
" left: 0;", | ||
" right: 0;", | ||
" background-color: blue;", | ||
" }", | ||
" </style>", | ||
"</html>" | ||
], | ||
"tags": ["html", "css", "layout", "sticky", "flexbox", "viewport"], | ||
"author": "GreenMan36" | ||
}, | ||
{ | ||
"title": "Grid Layout with Navigation", | ||
"description": "Full-height grid layout with header navigation using nesting syntax.", | ||
"code": [ | ||
"<!DOCTYPE html>", | ||
"<html>", | ||
" <head>", | ||
" <style>", | ||
" body {", | ||
" margin: 0;", | ||
" min-height: 100vh;", | ||
" display: grid;", | ||
" grid-template-rows: auto 1fr auto;", | ||
" background: red; /* Shouldn't be visible */", | ||
" }", | ||
"", | ||
" .header {", | ||
" background: #3b82f6;", | ||
" padding: 1rem;", | ||
" display: flex;", | ||
" & .menu {", | ||
" margin-left: auto;", | ||
" }", | ||
" & .menu ul {", | ||
" margin-left: auto;", | ||
" display: flex;", | ||
" gap: 1rem;", | ||
" }", | ||
" }", | ||
"", | ||
" .main {", | ||
" background: #f3f4f6;", | ||
" padding: 1rem;", | ||
" }", | ||
"", | ||
" .footer {", | ||
" background: #1f2937;", | ||
" padding: 1rem;", | ||
" }", | ||
" </style>", | ||
" </head>", | ||
" <body>", | ||
" <div class=\"header\">", | ||
" Header", | ||
" <nav class=\"menu\">", | ||
" <ul>", | ||
" <li><a href=\"#\">Home</a></li>", | ||
" <li><a href=\"#\">About</a></li>", | ||
" <li><a href=\"#\">Contact</a></li>", | ||
" </ul>", | ||
" </nav>", | ||
" </div>", | ||
" <div class=\"main\">Main Content</div>", | ||
" <div class=\"footer\">Footer</div>", | ||
" </body>", | ||
"</html>" | ||
], | ||
"tags": ["html", "css", "layout", "sticky", "grid", "full-height"], | ||
"author": "GreenMan36" | ||
} | ||
] | ||
} | ||
] |