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

Add HTML #44

merged 2 commits into from
Dec 31, 2024

Conversation

GreenMan36
Copy link
Contributor

It adds HTML as a language and adds two snippets for having a webpage with a sticky header and footer.
There's many ways to do this and I've added one for grid and one for flexbox.

Copy link

netlify bot commented Dec 30, 2024

Deploy Preview for quicksnip ready!

Name Link
🔨 Latest commit 7332066
🔍 Latest deploy log https://app.netlify.com/sites/quicksnip/deploys/6772fe31fcdba30008a7e653
😎 Deploy Preview https://deploy-preview-44--quicksnip.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

" <div class=\"body\">body/content</div>",
" <div class=\"footer\">footer</div>",
" </body>",
" <style type=\"text/css\">",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please move the style tag inside the head element ? Like you did for the second example ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a pain to do anything afterwards but I did the thing.

We really need a piece of code to go to and from the JSON

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#39

@Mathys-Gasnier Mathys-Gasnier added update needed Code needs to be updated. Snippets labels Dec 30, 2024
@technoph1le
Copy link
Owner

I was wondering if this code snippet actually belongs to HTML. As far as I understand, the main point of this snippet is making the header and footer sticky. Since it has more CSS, I feel like it would make sense to add it in CSS instead. Let me know your thoughts.

@Mathys-Gasnier
Copy link
Collaborator

Yeah it's true that the boundary between HTML and CSS is a bit complicated to place...
I think it belongs in HTML more, because of the fact that it's a "whole" feature/example
For me CSS snippets are more like: "This shows you how to use X feature of CSS" and not: "Here is how you make an element do X with CSS"

@GreenMan36
Copy link
Contributor Author

GreenMan36 commented Dec 30, 2024

I think this belongs in HTML. While it does contain CSS, this snippet is fundamentally about showing a working base layout template.

When people search for HTML examples, they often want complete, working examples they can use as a starting point. CSS snippets are usually about specific styling techniques (like "how to create a gradient" or "how to use grid"), while this is more about "here's a basic webpage layout that works."

The problem is that there's no objective answer here, as both are important. If I where to share the snippet less developed like so:

<!DOCTYPE html>
<html style="margin:0">
  <head></head>
  <body style="margin:0;min-height:100vh;display:flex;flex-direction:column">
      <div style="position:sticky;top:0">header</div>
      <div style="flex-grow:1">body</div>
      <div style="position:sticky;bottom:0">footer</div>
  </body>
</html>

To me it suddenly looks a lot less like it belongs in the CSS category.

@GreenMan36
Copy link
Contributor Author

Same for:

<!DOCTYPE html>
<html style="margin:0">
  <head></head>
  <body style="margin:0;min-height:100vh;display:grid;grid-template-rows:auto 1fr auto">
      <div style="display:flex">
          Header
          <nav style="margin-left:auto">
              <ul style="display:flex">
                  <li><a href="#">Contact</a></li>
              </ul>
          </nav>
      </div>
      <div>Main Content</div>
      <div>Footer</div>
  </body>
</html>

@Mathys-Gasnier Mathys-Gasnier merged commit e741ace into technoph1le:main Dec 31, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Snippets update needed Code needs to be updated.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants