286
irvollo
3y

Me: I’ve been in the web since 2006, of course i know html,css,javascript.
Also me: Google how to center a div.

Comments
  • 49
    Developers doesn’t really know anything. We’re just experts at google’ing, copy pasta. Biggest knowledge is reading and understanding code really
  • 11
    @ChainsawBaby Er, if you work years doing the same thing and still have to google every 5 minutes. Just maybe you are doing something wrong.

    Sure IT is dynamic and has a lot of rapid development which makes information generally temporary but c'mon just use the same method to center a div that has been there since the beginning of time or use flexbox.

    See it ain't that hard and I'm an sys admin student.

    If I was an painter and had to google how to paint every 5 minutes would you hire me?

    #commentIsActuallyAnRant
  • 17
    You can center a div but can you <div><a><center>?</center></a><div>
  • 9
    Horizontally or Vertically center?

    Vertically center a div was a pain back then 🤣

    Now we have translateY
  • 2
  • 1
    @AndreiKnight I know missing last / for the div but can't edit it now lol 🤣
  • 10
    @falmesino flexbox is the answer
  • 3
    @rootshell this seems a little harsh, if there were new and better ways of painting released every year, I’d be very happy for my painter to research the newest and best way of decorating whilst on the job...
  • 1
    @arcadesdude no, i was thinking about centering a <center> :))
  • 1
    @rootshell who centers divs all day? honestly?
  • 2
    @AndreiKnight lol I wonder if it is possible to uncenter a center?? Hrm...
  • 1
  • 2
    @commanderkeen front enders? :))
  • 4
    Use flexbois 😇
  • 4
    Use http://howtocenterincss.com/

    It even offers IE support.
  • 1
    @rootshell yeah, if you still have to google the same thing over and over again over many years, something isn't right.

    Eventually you should learn.

    What I tried to point out, devs are extremely good a googling and finding correct results, that's how most of us learn shit.
  • 1
    I’m not surprised considering it flipping changes all the damn time.

    God knows how animated transitions are trivial yet simple layout tasks require a blood sacrifice.
  • 0
    @SoulSkrix what's wrong with inline styling?
  • 2
    @rootshell Bad analogy.
    Unless you want to extend it to something like: You have to paint the wall, making sure the color matches any house it's applied to. Also, while you're doing that, fix the sink will ya'? And we need a foundation, why haven't you made that yet? Oh, you made it, but the wall looks out of place in MY outdated house. How come the paint looks different on my wall? I thought you were a professional painter?

    Read: Frontend is more akin to constructing a building than simply painting it. Centering a div is a common usecase, but not common enough so that it's all you'll be doing, far from it.

    This is a prime example of why I despise "clever" analogies between traditional professions and software development.
  • 0
    @rootshell @Codex404 @floatright @SoulSkrix
    As much as I fucking love flexboxes, they're'nt supported by IE
  • 1
    @SoulSkrix you cheeky little chicken
  • 0
    @SoulSkrix that was sarcasm... And ids should never be used for styling... Never never never....
  • 0
    @SoulSkrix Like when? Using id's for styling causes it to be less maintainable. Let's say you put some really specific exceptional styling on a button, and now I need the same styling to be put on another element. Now I've to change your CSS and your HTML instead of just using a class in my HTML...
  • 0
    @Codex404 ID's are faster right (by like a nano fraction) maybe there is some use case for that?
  • 0
    @falmesino a.k.a douchebag vertical-align 😆
  • 0
    @SoulSkrix I have made quite a few websites and web applications and never had anything that had to have completely unique styling which would never ever be used somewhere else.

    And I have run some tests in the past. Ids are not faster perse. It really depends on the browser and how the ids are used. As soon as the CSS is duplicated because it was made in ids before there is a performance loss.
    CSS and JavaScript also both act different towards ids. Where with JavaScript using ids is quicker in most cases CSS is most of the times a bit slower or have the same performance.
  • 0
    @SoulSkrix the reason ids and classes don't really differ for CSS is because CSS doesn't care if you have a unique id or have tons of duplicate ids. It will just style all of them.
    JavaScript on the other hand will stop looking after it has found one id, which results in a quicker execution.

    But this probably also depend per browser, but this were my findings in edge, Firefox and Opera 2 years ago.
  • 0
    @ChainsawBaby speak for yourself niunja
Add Comment