- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I'm still scratching my head...
Admin
Nothing terrible about CSS. Plenty of terrible about how people use it.
Admin
It's just a dirty trick to make columns of equal height (see for instance https://css-tricks.com/forums/topic/equal-height-columns-in-css/)
The 9999px padding is a bit unusual, but -9999px margins are pretty common, used for image replacement, or to hide content from screen (but leave it available for screen readers).
Admin
If you haven't needed horrible CSS, you haven't made complex layouts that actually worked cross-browser. And I'm not even talking about IE6, which is a layer of hell that's probably against Geneva conventions. (I started with IE3, which was just randomly buggy enough that you never knew if you actually screwed up or it was the browser. At least IE6 consistently fucked up.)
Admin
We have just come out from underneath a bug in IE whereby, unless you pass the IP4 address of the target URL to our web application, it shunts you into "quirks" mode. We'd been wondering why the hell our neat layouts in GC and FF etc. look completely unhinged in IE ...
Admin
Sounds more like some has turned on Enterprise Mode and has a bad Sites.xml.
https://technet.microsoft.com/en-us/itpro/internet-explorer/ie11-deploy-guide/what-is-enterprise-mode
Admin
Wow, that must have been a task figuring that out.
Admin
I think we call that "Stockholm Syndrome."
Admin
It's probably a botched image replacement technique. The below should now be your goto for such glorious things:
.hide-text { text-indent: 100%; white-space: nowrap; overflow: hidden; }
First described at http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/
Admin
Pfft. IE3 used HTTP/0.9 on its HTTP action/URL line, which meant that it was impossible to get anything from www.microsoft.com with it in 2000.
Seriously, its requests started
GET http://www.microsoft.com/ HTTP/0.9
...Admin
Frist is hidden due to CSS error
Admin
The real WTF with CSS and DIVs is that nobody ever tackled the root causes of why people use tables for layout. Relative width and height have zero context. Are they relative to child, the parent, or the screen? This lack of reference is why it's such a fight to get equal column heights or remove ye olde letterboxing effect from the sides of the screen or any number of other layout issues that inevitably follow when some hipster proselytizes for the Church of DIV.
Admin
If you want to talk about ierd IE behaviour, then consider this:
normal web form:
..... stuffIf you do that in IE, all looks normal until someone enters something in the auto complete field. When that happens the field vanishes but the auto complete suggestions can still be selected (and submitted), but the content of the field can no longer be changed as it is gone form view! The only way to get the field back was to reload the page.
In chrome and FF all worked as it should.
Can anyone spot what was causing the error (besides using IE i mean)? Evil grin
Yazeran
Plan: To go to Mars one day with a hammer.
Admin
OK, it ate some of the stuff (sigh):
start_table
stuff
start_table stuff form input field with autocomplete end_form
end_table
stuff
script jquery code end_script
Admin
This was a technique from the early 2000s to provide what CSS appeared not to be able to deliver in the early days of table-less layout, columns of equal height. I discovered the technique and it leaked out our company on to Position is Everything thanks to an intern. It is not useless, but I will leave you scratching your heads as to how it did anything useful, my job still seems to be about counter-intuitive solutions to problems :)
Admin
At first, I thought you were kidding (I use RSS). All I can say is: THAT'S ONE HELL OF A NEAT HACK!
Admin
TRWTF:
I was having trouble clicking "Archive" to access older posts on the front page.
Why?
The use of style="padding: 1rem 1rem 9999px; margin-bottom: -9999px;" in this post s blocking most of the "Archive" link (except for the edges).
Admin
I think it's both. Most developers are bad at writing CSS and CSS is horrible. Before web components, it wasn't possible to encapsulate your CSS. If you wrote a selector
.my-widget .amount
and someone else just wrote.amount
for a different part of the application, they clobbered you and you had to stop using theamount
class on your element. The most robust way to solve this problem for large applications is to use long ugly class names like my-widget__amount for all CSS, but this is also horrible.If you're the only person writing the CSS for a project, then it's your fault if selector collision and bad cascading cause problems for you, but if you're on a large project, it's only a matter of time before a careless developer clobbers your widget. Who writes a language where everything is coupled with everything by default?
Admin
@J Kirschner:
Could not replicate.
@Alex:
No. What exactly do you think the 'C' in 'CSS' means? CSS has always supported contextual selectors. (source)[https://www.w3.org/TR/CSS1/#contextual-selectors]
Admin
@Paul Neumann > @J Kirschner:
Replicated -- "front page" was the key! (Never thought I would say those words in that order. At least it wasn't Front Page Express!)
Admin
That's the kind of hack you would need in two cases:
Admin
After the meme the other day, I half-expected a risque pic to go with this article. :-(
Admin
I use an RSS reader and it basically broke the whole article. This style got applied to the div that wraps the content from the site
style="padding:9999px;margin-bottom:-9999px;"
and so the whole article was hidden and 9999 pixes tall.Admin
input is self-closing and IE went quirks looking for a /input that never came?
(Why could I guess that after fifteen seconds?)
Admin
Nope, more sinister than that by far (although all my formatting etc went to hell in the forum so not obvious)
The cause was a missing end table tag, that is for an element completely unrelated to the form element (or more specifically 2 or 3 parent levels up in the DOM)!
I had started a main table. Inside that (along with other stuff) i had an inner table with the form elements for proper alignment etc.
I had not ended the outer table by mistake and although it is a bad habit it is not illegal as the HTML spec allows for unterminated tags as long as they are unambiguous (that has been pointed out to be a WTF in the HTML spec by numerous people though)
FF and Chrome behaved as they should, but IE had that strange quirk. Funny thing, the layout looked as it should, so i did not suspect an error in the table layout.... took me hours to hunt down. I first nailed it when I noticed that my page footer was misaligned (due to the missing end table tag)
Yazeran
Admin
The only reason people use tables for layout is they don't understand or care about the technologies they're using - display: table-cell has been a thing for years if you want to replicate table behaviour. HTML is a semantic markup language.
Admin
No, it didn't, because HTTP 0.9 didn't make requests like that. The host only was added to requests at HTTP/1.1, and it is plainly idiotic to include the protocol to use inside the handshake of the protocol.
It would have been "GET / HTTP/0.9"
Admin
I actually had a legitimate use of large padding and negative margins.
Someone had written a card games extension for Firefox using its UI markup dialect. One of the things you were allowed to do was to drag the cards around the window, of course.
However this created two issues. The obvious one was that dragging the card so that it overlapped the right edge of the window caused the container element to expand and then all the relative sizing followed suit.
The less obvious one was that dragging a card (or more likely, a stack of cards) so that it overlapped the bottom of the window was terribly slow for no apparent reason.
I discovered that adding large amounts of padding and negative margins fooled the layout into keeping the container element the same size so that neither of these effects triggered.