Git Product home page Git Product logo

wtf-html-css's Introduction

WTF, HTML and CSS?

WTF, HTML and CSS? is a list of reasons HTML and CSS might make you say what the fuck. It's a curated list of commonly frustrating HTML and CSS quandaries, miscues, and dilemmas, created with the goal of making them less common.

Start reading ☞


Contribute

Open an issue or a pull request to suggest changes or additions.

License

MIT licensed. Copyright 2014 @mdo.

Translations

Translations are maintained by their creators and may not always be up to date with the original here.

Have a translation you'd like to link to? Open a pull request to add it here. Be sure to keep it alphabetical.

<3

wtf-html-css's People

Contributors

adrianleb avatar amitburst avatar cvrebert avatar elforastero avatar fulldecent avatar lizheming avatar makotot avatar markstickley avatar mdo avatar pborreli avatar sayzlim avatar snack-x avatar tarciozemel avatar tjoosten avatar uncasually avatar zlatanvasovic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wtf-html-css's Issues

IE6 & inline floats

Hello!

Just a quick note about this:

Fun fact: Years ago, we had to set display: inline; for floats to work properly in IE6. However, those days have long passed.

Floats would work fine in IE6, the use of display: inline; was to avoid the famous Double Margin bug.

But yeah, those days have long passed. Thank **** for that.

Gradients cannot be transitioned

Gradients won't transition to other gradients, some folks might not know and think their code is wrong when it isn't working.

A possible workaround is to make the background color of the element a solid color, and use :before to add a transparent gradient above the element. Then you need only transition the background from one solid color to another.

Site padding

I think padding is being doubled from the body and the container. Should consolidate.

white-space vs nowrap vs pre-wrap vs pre-line

Is this only about things that require workarounds? One really annoying WTF for me is the inconsistent dashes between white-space ("whitespace" is a word, who the fuck uses a dash?!), nowrap (they're 2 separate words! "nowrap" isn't a word! This is where there should be a dash!), pre-wrap, and pre-line (unlike "no-", "pre-" is an actual prefix and not using a dash possibly makes sense).

The workaround is just using the specced keywords, of course.

RE:README.md, by additions do you mean a new WTF issue

Because my pet peeve is no block level elements within a paragraph. Why would I want that? I work in publishing, and we often have documents where the original text was something like:

<p> Some paragraph text

<blockquote> obvious block quoted material from another source</blockquote>

a continuation of the same parent paragraph.</p>

This causes problems when it comes to the HTML. Part of our office are old school SGML guys who preach the wonder that is XML. But the resulting HTML from this is invalid and the browsers through a fit as it will be translated as follows:

<p> Some paragraph text</p>

<blockquote> obvious block quoted material from another source</blockquote>

a continuation of the same parent paragraph.

maybe I'm just not finding the right XSLT for my situation, or maybe I am still won over on the argument that my HTML should be semantic. If it is all the same paragraph shouldn't it be contained within the same p? Secunia with this solution I now have to use something like data-id, because id's need to be unique, but we need to associate the three parts together. It's really a WTF situation.

Margin-collapse In CSS

I just spend 2 hours debugging a margin-collapse issue. I think it deserves to be added

IE 9 limit on number of stylesheets

In the Internet Explorer's selector limit section, add that IE 9 and below the limit combined number of style tags and stylesheet references to 31 (and ignore everything after that).

Apple iOS Safari Bug Report for rem issue

In case you are still interested, here is the link for reporting bugs to Apple about Safari and other issues.

Apple Bug Reporter

Caveat: Must be registered in the Apple Developer Program to submit, it is open to all but it is an extra step 😒

While at it, tried to submit the bug, but couldn't reproduce this issue in Safari for iOS 7 and iOS 6.1. on an iPad or iPhone. ?

Replaced elements absolutely positionned

Hi,

just below "Position and width", it could be good to mention "replaced elements absolutely positionned", which is quite… wtf.

Here is the text you could add:

Don't use width… except if you are in the case of a replaced element that is absolutely positionned. I this case, there are some weird and difficult to understand rules that apply. Specially in this case, the browser will ignore the right value. It is not a bug, it is a feature of the spec.

Here is a pen that explains it : http://codepen.io/nico3333fr/pen/wBQJWe

Do you want a PR for this ?

See you,
Nicolas

Firefox still needs a reset for button elements

In “Firefox and <input> buttons”, the advice “Just use the <button> element” is wrong.

Firefox does add a pseudo-element in the shadow dom (I think) of button elements, and the fix that is mentioned for <input> buttons should be applied to <button> elements as well.

Last tested on http://fvsch.com/code/button-css/ with Firefox 30 (Aurora) on OS X.
How to reproduce: go to that page using Firefox 30-, use the Style Editor in the devtools, go to the inline stylesheet and remove this code:

button::-moz-focus-inner {
  padding: 0;
  border: none;
}

The black button should expand by a few pixels. In my test it was 239×27 pixels with the reset, and 245×29 pixels without the reset.

Reduce vulgar language

While it's a great idea and resource, one problem with this site is that it has some vulgar language on it. Not that I'm for this type of censorship in general, but I would like to link to this resource (e.g. to co-workers) but owing to the language, it would probably be inappropriate. Others (in Hacker News comments) have expressed this sentiment too, so I'm not unique in this regard. It seems like an unnecessary barrier to dissemination.

transparent in Firefox css gradients

When you use the transparent as one of the values in css gradient (linear or radial), it doesn't acts as one would expected. Only appears in Firefox.

E. g. linear-gradient(to right, #ccc, transparent 20%, transparent 80%, #ccc); creates gray full-width background instead of fading on sides. It works if you use rgba(204, 204, 204, 0) instead of transparent, but doesn't if you use transparent itself, or even for example rgba(0, 0, 0, 0).

This was quite a WTF moment for me, so I'm mentioning it here.

Please correct me if I'm wrong and this is desired behavior.

CSS does not define default text and background colors

Firefox even has a setting (not in about:config but in the normal settings, a.k.a. about:preferences) for it under Content > Colors... (button). And the best thing? This very site ignores that fact and sets the text color but not background color, leading to the following with my current Firefox setup:

bildschirmfoto am 2017-03-07 um 17 03 30

Button value doesn't work in IE6 and IE7

Using the button element, as suggested in the "Firefox and buttons" section can cause problems in IE6-7 if you also want to use a value on a button.

In these versions of IE, any value you assign will be ignored, and the innerHTML of the button will be used instead. If you don't use values on buttons you may not be affected by this, but it is something that is worth being aware of.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.