I am not allowed to credit the site that has this disaster. Its owner said “Nobody should see that”

      • Pasta Dental@sh.itjust.works
        link
        fedilink
        arrow-up
        24
        arrow-down
        1
        ·
        4 months ago

        At least that’s actually easy and quick to do and is the only way of doing it. Centering a div however has 81639393 ways and it seems the one that works is different every time

        • Codex@lemmy.world
          link
          fedilink
          arrow-up
          45
          ·
          4 months ago

          Bro its so easy bro, just use flexboxgridcolumns its been a standard since 2010 just flex it bro you haven’t learned to flex yet just check w3c schools and add a flex you can polyfill it but don’t use that hacked one use the good flexpolyfill then { content-align-middle-child-elements: center-middle-true-neutral } so easy with flex bro

          • CatLikeLemming@lemmy.blahaj.zone
            link
            fedilink
            English
            arrow-up
            16
            ·
            4 months ago

            I know you meant this sarcastically, but yes, flex is a good option for centering something. Either that or setting the left and right margins of the element to auto, which is generally even easier.

            Basically, if you’re in a flex container use flex, if you’re in a grid use grid, and if neither of those apply set the left and right margins to auto.

            • marcos@lemmy.world
              link
              fedilink
              arrow-up
              5
              ·
              4 months ago

              Also seriously, anybody having problems with flexbox should try this:

              https://flexboxfroggy.com/

              I’m not sure there’s any version of it for grids, but IMO grids are inherently more intuitive, so it may not be needed. Flexbox is the one that is hard to learn.

              • CatLikeLemming@lemmy.blahaj.zone
                link
                fedilink
                English
                arrow-up
                2
                ·
                4 months ago

                Well, flexbox and grid have different purposes in my opinion/experience. Personally I use grid for “top level” layouts like the layout of the whole site, while I tend to prefer flexbox for layouts inside the grid. Of course that’s just a rule of thumb, there are absolutely cases where this isn’t the best option.

              • davidgro@lemmy.world
                link
                fedilink
                arrow-up
                2
                ·
                4 months ago

                I don’t know any CSS (despite reading memes about it like this) but I do know that the bottom of that page has a link to something called Grid Garden

          • drathvedro@lemm.ee
            link
            fedilink
            arrow-up
            1
            ·
            4 months ago

            It’s 2024 and flexboxes still don’t work that well with vertical direction and wraparound…

              • drathvedro@lemm.ee
                link
                fedilink
                arrow-up
                2
                ·
                4 months ago

                Sure. Here you go. The green container should cover all red boxes in both cases. I’ve been bashing my head against this issue for a while, but, as far as I understand, this is a bug that’s never going to be fixed. Which sucks, because I wanted to re-design some of the apps in the horizontal metro-style scrolling manner for the bottom screen on my zephyrus duo, but this effectively prevents me from doing so (Unless I use grids and set positions manually).

                • bleistift2@sopuli.xyz
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  4 months ago

                  That’s interesting. Chrome displays it as you intended, Firefox doesn’t. I guess it’s required that the vertical flex be inline-flex?

      • kamen@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        4 months ago

        It’s a good indicator that someone is desperate and/or doesn’t know what they’re doing.

  • 9point6@lemmy.world
    link
    fedilink
    arrow-up
    35
    arrow-down
    3
    ·
    4 months ago

    Not allowed to credit the site in your text editor?

    Is the owner in the room with you now?

  • drathvedro@lemm.ee
    link
    fedilink
    arrow-up
    17
    ·
    4 months ago

    I’m appalled that classes representing visual styles are still a thing. I thought everyone already figured that it was a bad idea back in bootstrap days. But then I recently had an opportunity to work on project that uses Vuetify and saw quite long poems about flexboxes in class names…

    • smooth_tea@lemmy.world
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      4 months ago

      “Figured it was a bad idea” actually means that some people were against it because they believed semantic class names were the solution, I was one of them. This was purely ideological, it wasn’t based on practical experience because everyone knew maintaining CSS was a bitch. Heck, starting a new project with the semantic CSS approach was a bitch because if you didn’t spend 2 months planning ahead you’d end up with soup that was turning sour before it ever left the stove.

      Bootstrap and the likes were born out of the issues the semantic approach had, and their success and numbers are a testimony to how real the issue was, and I say this as someone who never used and despised bootstrap. Maintaining semantic CSS was hard, starting was hard, the only thing that approach had going for it was this idea that you were using CSS the way it was meant to be used, it had nothing to do with the practicality. Sure, your html becomes prettier to look at, but what good is that when your clean html is just hiding the monstrosity of your CSS file? Your clean html was supposed to be beneficial to the developer experience, but it never succeeded in doing that.

      • Aux@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        4 months ago

        There’s nothing hard about semantic naming. Especially when you’re separating your elements into components and use SCSS or some other pre-processor.

        • smooth_tea@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          Either you understand that the consensus is that naming things is hard and you just want to elevate yourself above everyone else by arguing against it, or you’re unaware that it is the consensus, in which case your opinion doesn’t really matter because you most likely underestimate the issue.

          It’s such a truism that I’d suggest googling "naming things is hard*.

          There are only two hard things in Computer Science: cache invalidation and naming things. – Phil Karlton

          https://www.namingthings.co/

  • aeronmelon@lemmy.world
    link
    fedilink
    arrow-up
    17
    arrow-down
    1
    ·
    4 months ago

    “Some coders just want to watch the word burn get colored white and/or lime.”

    And if you delete one or the other, or condense the code into a single command, the whole site breaks.

  • dajoho@sh.itjust.works
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    4 months ago

    I am very, very surprised about the competence of the commenters here. I have had many discussions on reddit about the advantages of meaningful instead of presentational class-naming and you’re normally met with great resistance, especially with users of frameworks like Bootstrap and Tailwind.

    Here, everyone seems to either ‘get it’ or is willing to hear why classes like .lime are bad. Very cool.

  • Holzkohlen@feddit.de
    link
    fedilink
    arrow-up
    5
    arrow-down
    2
    ·
    4 months ago

    I hate all webdev beyond using raw HTML, CSS and Javascript to make your own crappy website