Live data from Hacker News

HTML hacks that shaped the Internet

tedium.co

81–90 of 233 posts

Re: HTML hacks that shaped the Internet

#81
post #73

Using tables for layout is pretty understandable. But when tables went out of fashion it was all about using floats for layout for a few years. That was wild, I am surprised it was left out from that list. https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layou... "Originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple column layo…

Speaking of floats being used for layout, you could probably add the clearfix hack to this list too. That was an essential part of my CSS toolbox for years, and something that ended up being one of the first things added in every new project. https://css-tricks.com/snippets/css/clear-fix/

The linked article includes an example of the "commented backslash hack," a variation on point #3 in this article

Fell out of use because "nobody uses IE for Mac" :)

Re: HTML hacks that shaped the Internet

#83
post #39
post #15

It's funny how we came around to JSSS, and it's now everywhere: from CSS-in-JS to web components coding their CSS in strings inside Javascript

I've looked up some JSSS code examples, and it seems like it's pretty much the only type of code where the "with" keyword makes sense: tags.H1.color = "red"; tags.p.fontSize = "20pt"; with (tags.H3) { color = "green"; } with (tags.H2) { color = "red"; fontSize = "16pt"; marginTop = "4cm"; }

I think it also makes sense in Python, where it can be used to automatically close a file, or

  with open(filename) as my_file:
      data = my_file.read()
Or with acquiring and releasing a lock:

  lock = threading.Lock()
  with lock:
      pass # do stuff

That being said, I prefer the C++ approach of using constructors and destructors to automatically acquire resources (like locks and files) by declaring variables within some block scope, and release them once the scope is left.

Re: HTML hacks that shaped the Internet

#84
post #55

Earlier quoted context omitted.

I’m still bullish on the possibility of Microsoft edge shaking up this dynamic a little, but maybe I’m naïve.

They did start https://open-ui.org which really deserves special recognition.

This is a cool idea! Thanks for the link <3 :)

Re: HTML hacks that shaped the Internet

#85

Why exactly was Internet Explorer so bad? In hindsight, it looks like a huge missed opportunity for Microsoft.

It had the majority share of users, lots of bugs, and didn't update itself (in the sense that modern evergreen browsers do).

This turned into a chicken/egg problem where apps only worked in IE6. Mitigated somewhat by "evergreen" browsers that update themselves regularly.

Re: HTML hacks that shaped the Internet

#86

Using tables for layout is pretty understandable. But when tables went out of fashion it was all about using floats for layout for a few years. That was wild, I am surprised it was left out from that list. https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layou... "Originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple column layo…

If you're specifying @screen as the Media Type, the primary reason I can think of for going back to floats is art direction - especially if you wanted to float images alongside a block of text. I know there are "better" methods in more modern versions of the spec, but this is one that still seems to get a fair bit of use.

Old CSS never dies, it just goes to live on a very special farm upstate where it only has to do 1 or 2 jobs.

Re: HTML hacks that shaped the Internet

#87

Sometimes I can't tell if modern web developers are spoiled, by having CSS Grid and IE being dead. Or if we were spoiled back then, by not having to deal with the complexity of modern frameworks and build processes.

There is something unique in web development connotation to the other fields I've worked in. The industry has made a habit of reinventing the wheel in every more complex ways. My best guess is that this is a side effect of web being a field that's more often picked by new or less experienced devs.

The web is essentially UI development. And UI frameworks and libraries have always had lots of churn. Even ultra-conservative Java has had AWT, Swing, and a couple varieties of JavaFX. And then a few more developed by other groups like SWT. The expectations of both developers and users increase as computers advance, and older frameworks can't always keep up.

Re: HTML hacks that shaped the Internet

#88

Using tables for layout is pretty understandable. But when tables went out of fashion it was all about using floats for layout for a few years. That was wild, I am surprised it was left out from that list. https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layou... "Originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple column layo…

As W3Schools still likes to call it: the new, modern clearfix hack [1]

    .clearfix::after {
      content: "";
      clear: both;
      display: table;
    }
[1] https://www.w3schools.com/howto/howto_css_clearfix.asp

Re: HTML hacks that shaped the Internet

#90
post #46

Using tables for layout is pretty understandable. But when tables went out of fashion it was all about using floats for layout for a few years. That was wild, I am surprised it was left out from that list. https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layou... "Originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple column layo…

The era between tables and flexbox/grid was a difficult one. Floats were finicky and hard to get right. A lot of people just went back to tables, and I honestly didn't blame them.

I had an internship during college at a small web shop that did a ton of HTML mail. Early on, after I had completed a project, they took a half day to try and teach me how floats worked.

Note: If you think web browsers are weird, just wait until you try doing things in email clients or - $deity forbid - ebook readers.

As you say, it was weird and initially quite difficult to wrap my head around it. Surprisingly, I didn't actually learn about the "clearfix" hack until a couple of years later when I interviewed for a Front-End job at - of all places - Fox News.

The person who I talked with there gave me a take-home to work on and send back. Tl;dr I didn't get it quite right because I hadn't really taken the time to understand what the particular styles did to the layout.

Fast-forward to today and I'm using floats w/ @print and a div class of "clearfix" set to "both" in order to reset the layout of a document that was converted from Word's .docx to HTML.

How times change.

Post reply on HN