CSS Attributes

by Banned 9 replies
10
Is there a prescribed order for CSS attributes, or does it matter? It seems logical to start with the common elements such as font type, size, and color. That's usually what I do, and I add anything else I use in random order. Should I be doing it differently?
#website design #attributes #css
  • As far as I know there isn't any prescribed order except maybe for things like the pseudo classes for your <a> tag like "link, visited, hover, active". Beyond that I generally order things according to their in the site or document i.e. wrapper, header, menu, lefttColumn, mainContent, rightColumn, footer. And from there things like h1, h2, p, ul etc. etc.
  • I am not aware of any rules.
    I like the common stuff like basics, header, footer near the top
    and less used stuff like page specific tweeks at the bottom.

    The order you apply does not matter. As long as you know
    the later stuff will trump the earlier stuff.
    • [1] reply
    • I don't think there is any standard for that.
  • yeah ive never come across any standards, whatever seems logical for yourself really
  • According to my opinion there is no such order.
  • W3C has not defined any specific order for CSS. Why should there be an order anyways? It would just make it unnecessary complicated.
  • we should do with a concept that is neat and orderly, it is very important in optimizing future resource
  • I guess there aren't any real rules to follow. Someone already mentioned this and that is to do what feels comfortable for you. I like organization and order therefore my rules will follow a certain logic, but that is just me.

Next Topics on Trending Feed

  • 10

    Is there a prescribed order for CSS attributes, or does it matter? It seems logical to start with the common elements such as font type, size, and color. That's usually what I do, and I add anything else I use in random order. Should I be doing it differently?