Grow your CSS skills. Land your dream job.

Deactivating Styles?

  • # June 27, 2011 at 12:34 pm

    If I’m working with an HTML document, and I’m trying to figure out what styles I want to keep active, what is the best way to deactivate certain styles in the CSS document? Is there a technique where I can deactivate them, and come back to activate them later? Something similar to commenting out code, but perhaps less time consuming?

    Thanks,
    Marty

    # June 27, 2011 at 6:43 pm

    I think commenting out the code will be the best solution.

    # June 28, 2011 at 5:01 am

    i would say in the actual coding process theres just the commenting out, however if you use firefox and have an addon called webdeveloper, currently version 1.1.9 that allows you to turn on and off styling elements in the css.

    # June 28, 2011 at 5:48 am

    Good call @furrball1383. Chrome Inspector does the same thing.

    # June 28, 2011 at 7:31 am

    If I need to deactivate a style I just put x before them for example:

    #container { xwidth:920px; width:600px; margin:0px; }

    This works well for me :)

    Or if you wanted to remove the entire div:


    x#container { width:600px; margin:0px; }
    #container { width:300px; }
    # June 28, 2011 at 11:21 am

    yeah but those x’s will catch up to you if you’re not using an editing program that catches mistakes when you’re finally done with your site. For example till about a month ago i swore by notepad since that is the only program besides photoshop that I have used in my study of web development, but a single solitary x somewhere could send me searching for hours.

    # June 28, 2011 at 1:01 pm

    @furrball1383
    Notepad works, but you should try some better tools. notepad++ and notepad2 are both good, though I prefer notepad++. Sorry for the off-topic.

    @Dolatron
    Say you have this style:


    #example {
    width: 90%;
    margin: 1%;
    background-color: #333333;
    color: #cccccc;
    border-radius: 15px;
    }

    and you want to see how it looks without the border-radius. To do that, just do this:


    #example {
    width: 90%;
    margin: 1%;
    background-color: #333333;
    color: #cccccc;
    /*
    border-radius: 15px;
    */
    }

    The

    /*

    starts a comment, and the

    */

    ends it.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".