Skip to content

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

Merged
merged 2 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions public/data/_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"lang": "CSS",
"icon": "/icons/css.svg"
},
{
"lang": "HTML",
"icon": "/icons/html5.svg"
},
{
"lang": "Python",
"icon": "/icons/python.svg"
Expand Down
119 changes: 119 additions & 0 deletions public/data/html.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
[
{
"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>",
" <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>",
" <head>",
" <body>",
" <div class=\"header\">header</div>",
" <div class=\"body\">body/content</div>",
" <div class=\"footer\">footer</div>",
" </body>",
"</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"
}
]
}
]
8 changes: 8 additions & 0 deletions public/icons/html5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy