Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

CSS Hacks

  • 06-03-2006 10:28PM
    #1
    Closed Accounts Posts: 4,655 ✭✭✭


    So people where do you find your hacks?

    I have trawled through loads of css files and I have seen loads of hacks - and yet I can never find an explanation for any of them

    For example, so of the strange markups I have see are:

    |margin
    mar\gin
    !important

    And so on.
    So does anyone know where I can read up on the above or in fact a good central repository for such hacks, etc


Comments

  • Registered Users, Registered Users 2 Posts: 8,538 ✭✭✭jmcc


    Ph3n0m wrote:
    So people where do you find your hacks?

    I have trawled through loads of css files and I have seen loads of hacks - and yet I can never find an explanation for any of them
    The CSS Anthology - 101 Essential Tips, Tricks & Hacks. (A fairly good book with explanations.) Also the Wrox book:
    CSS - Cascading Style Sheets for Web Design.

    Regards...jmcc

    Regards…jmcc



  • Registered Users, Registered Users 2 Posts: 2,209 ✭✭✭Serbian


    I think the main one is PositionIsEverything. If you see odd mark-up in a CSS file, often searching Google with the exact hack will throw up what the hack is. I found an explanation of what the mar\gin hack is.

    Just as a FYI, !important is not a hack in itself, it applies the rule that is associated with !important regardless of whether the style has been changed later on in the CSS document or not.

    Take the example below. Not knowing what !important did, you would expect the border on the box to be red, but it is in fact black.
    <html>
    <head>
    <title>Test</title>
    <style type="text/css">
    <!--
    .box {
    	border: 1px solid #000 !important;
    	border: 1px solid #c00;
    }
    -->
    </style>
    </head>
    
    <body>
    <div class="box">&nbsp;</div>
    </body>
    </html>
    


Advertisement