• Korthrun@lemmy.sdf.org
    link
    fedilink
    arrow-up
    6
    ·
    4 hours ago

    Lol, easier to write an article theorizing the ways it can be done than to just show him a centered div.

  • TrickDacy@lemmy.world
    link
    fedilink
    arrow-up
    16
    arrow-down
    1
    ·
    9 hours ago

    Do people who talk this kind of shit about css really not understand they’re just admitting they’re not good at css?

  • tiredofsametab@fedia.io
    link
    fedilink
    arrow-up
    52
    arrow-down
    1
    ·
    13 hours ago

    <CENTER><DIV>just as the founders intended</DIV></CENTER>

    / If your language has 58 ways to accomplish something like that, you’re in for a bad time.

  • hperrin@lemmy.ca
    link
    fedilink
    English
    arrow-up
    25
    ·
    13 hours ago

    Centering a div is pretty fucking easy nowadays. What’s way harder is aligning a god damned SVG icon with text.

    • YoSoySnekBoi@kbin.earth
      link
      fedilink
      arrow-up
      10
      ·
      11 hours ago

      Even that is pretty easy nowadays with modern CSS:

      <div> <svg /> Text </div>
      
      div {
          display: flex;
          align-items: center;
      
          /* If the SVG needs an offset */
          & svg {
              --offset: ...px, ...px;
              transform: translate(var(--offset));
          }
      }
      
      • onlinepersona@programming.dev
        link
        fedilink
        arrow-up
        11
        arrow-down
        1
        ·
        10 hours ago

        Yeah. Easy. So easy. Text size changes, svg not centered anymore. Add margin (or whatever that inside margin is called), and tada, not centered.

        • funkless_eck@sh.itjust.works
          link
          fedilink
          arrow-up
          11
          ·
          8 hours ago

          padding

          At the risk of getting flamed - I wonder if because CSS is a design tool not a programming tool, it will seem unintuitive to people from a technical background, but more intuitive to people from a design/arts background

          • TrickDacy@lemmy.world
            link
            fedilink
            arrow-up
            4
            ·
            edit-2
            6 hours ago

            Exactly this ^

            When we had “backend” people at my shop, they were god awful at css. It was so bad at one point that I scolded any backend person who touched css because they always fucked shit up if they did.

          • onlinepersona@programming.dev
            link
            fedilink
            arrow-up
            6
            ·
            7 hours ago

            I think you’re right. CSS was more understandable to me after reading that it came from the world of print media. It’s how things were laid out there and it was transformed into a language from those with domain knowledge.

            But I would be curious if those who studied art also use the same terminology. If so, then it would make sense that it would seem more intuitive to them.

        • YoSoySnekBoi@kbin.earth
          link
          fedilink
          arrow-up
          2
          ·
          4 hours ago

          I’m confused - it’s the only non-semantic standard html container. Ofc it’s bad if you’re trying to communicate intent, but if it’s just for minor layout tweaks, anything else would mess with the document structure. Find me one sufficiently complex website that doesn’t use divs lol

  • LumpyPancakes@piefed.social
    link
    fedilink
    English
    arrow-up
    9
    ·
    11 hours ago

    I only know how to stick it in a cell in a table and center the cell.

    Never learned css, a bit left behind now hehe.

  • finitebanjo@piefed.world
    link
    fedilink
    English
    arrow-up
    18
    arrow-down
    2
    ·
    14 hours ago

    Oh, sorry, you can’t use float to align items side by side in desktop and top to bottom in mobile in this context while specifying the height! Looks like you just won’t have a reactive website, jackass! Maybe go back to flexbox with all the nonreactive weenies, loser!