My Lemmy Oracle
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
King@sh.itjust.works to Programmer Humor@programming.devEnglish ·
edit-2
1 month ago

Centering a Div

i.ibb.co

message-square
62
fedilink
287

Centering a Div

i.ibb.co

King@sh.itjust.works to Programmer Humor@programming.devEnglish ·
edit-2
1 month ago
message-square
62
fedilink

comiCSS

  • cbazero@programming.dev
    link
    fedilink
    arrow-up
    24
    arrow-down
    5
    ·
    1 month ago

    If you need to be good at a layout language to center something, then maybe the layout language sucks.

    • TrickDacy@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      1 month ago

      What it says is zero knowledge on the part of the whiner.

    • irelephant [he/him]@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      1 month ago

      You literally just have to give it a width and add margin: 0 auto;

      • humorlessrepost@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        1 month ago

        I think it’s implied they’re talking about centering both horizontally and vertically. And probably with unknown height.

        Still easy these days , though.

      • 𝕱𝖎𝖗𝖊𝖜𝖎𝖙𝖈𝖍@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        1 month ago

        Or use Flexbox

        But your solution works as well for simple cases

        • irelephant [he/him]@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          1 month ago

          I generally avoid flex for simple stuff (i like weird browsers), but for more complex layouts it should certainly be used.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.15K users / day
  • 4.34K users / week
  • 8.39K users / month
  • 18.2K users / 6 months
  • 1 local subscriber
  • 29K subscribers
  • 2.11K Posts
  • 78.4K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org