• vote
    1
    0 starsTosh | Shared With: Everyone - Mar 07 2008 | css, html, development
    Does CSS float?

    Didn't know about the overflow and :after techniques before.

    Quoted: A common difficulty associated with the clear property is that its use requires adding extra markup in the document on subsequent elements.
    ...
    Several authors have proposed various techniques to eliminate the need to add extra markup to the HTML document. These techniques include:
    ...
    Add "float" to the container element.
    Add "overflow:hidden" to the container element.
    Add a CSS2 ":after" pseudo-class on the container element .

    You must be Tosh's friend before you can comment on this Fave.
    Send Tosh a friend request or a personal message instead.

Related Faves from Tosh

  • vote
    9
    0 starsTosh | Shared With: Everyone - Jul 10 2008 | css
    A List Apart: Articles: Faux Columns

    Quoted: A simple method of making CSS columns appear equal in length, regardless of the content that they contain.

  • vote
    2
    0 starsTosh | Shared With: Everyone - Mar 20 2008 | css
    Creating the 6th version of our website

    Quoted: The one thing I can say if you are a web developer is to do not buy the BS of separation between content and style. If you do that you'll end up w/ a gigantic unmaintainable CSS (I've seen that CSS file in some startups).

    Now we discover why Sampa has a ton of inline styles. Anyhow this is a blanket statement, which in many cases is not correct. Separating your styles into a separate, cacheable stylesheet is a good thing in cases where your HTML page changes frequently and is not cached i.e., an email inbox, a faves list, a news feed, etc. In this way you minimize your bytes over the wire cost. Pages download and render faster. (Of course, if your serving video or large files, BOW saving may be negligible.)

    I don't buy the idea that a web page with inline styles is easier to maintain than a page no inline style and a cached stylesheet. Separating to cacheable external stylesheets do not have to result in a "gigantic unmaintainable CSS". Take some care to componetize your CSS in separate files. There's no reason why you have to end up with a mess in your CSS or your HTML.

  • vote
    1
    0 starsTosh | Shared With: Everyone - Mar 15 2008 | css, development, ie6

    Quoted: The Star-HTML Hack
    The star-HTML hack is based on a bug of IE6’s DOM. The correct implementation for a HTML document would be to have the <html> element as the root element, but for some reason IE6 has a hidden element as the root element, which has the <html> element as its child.
    ...
    Because of this mysterious parent element in IE6, we can use the descendant selector to apply CSS rules to IE6 only.
    ...
    For instance, the * html p selector tells user agents to apply a style to a <p> element, which is a descedant of the <html> element, which is a descendant of any element.

  • vote
    2
    0 starsTosh | Shared With: Everyone - Mar 06 2008 | css

    CSS specificity rules

    Quoted:
    count 1 if the declaration is from is a 'style' attribute rather than a rule with a selector, 0 otherwise (= a) (In HTML, values of an element's "style" attribute are style sheet rules. These rules have no selectors, so a=1, b=0, c=0, and d=0.)
    ...
    count the number of ID attributes in the selector (= b)
    ...
    count the number of other attributes and pseudo-classes in the selector (= c)
    ...
    count the number of element names and pseudo-elements in the selector (= d)