Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm a relative newb at CSS as I just launched my site last October... I'm mostly self-taught and I LOVE reading stuff like this. Can I beg you for a response?

>All components should be left totally free of widths; your components should always remain fluid and their widths should be governed by a grid system.

Okay. I just got away from fixed widths and I like it, so I'm on board so far....

>Heights should never be be applied to elements. Never ever set heights on ps, uls, divs, anything.

Okay, but here's where I'm lost. I learned somewhat early on that for a container that will contain anything other than text, you should do something like:

  .container{
      height: auto !important;
      height: 100px;
  }
Supposedly this ensures that the page is pre-rendered okay before images and such are loaded. It may have been an IE6 workaround for something that I don't use anymore... whatever the reason it's still in my code, is it some rubbish that I should do away with?


I’ve honestly never heard of that being advocated; I’d drop that ASAP if I were you. If you want to ensure there is no page jump as images load then simply give the images width and height attributes :)

H


I do that already because that just makes sense, but I've been working to clean up my super-newb CSS recently and I'm trying to make it more manageable. I've been using trial and error for the stuff I'm unsure of but that one says it's !important and I didn't want to tempt fate. :D

I'll cut it and see what happens.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: