Please Help With the Css Code!

Discussion in 'CSS' started by farooqwani, Jan 12, 2010.

  1. #1
    Please help me locating the css code so that i can compress it, with a compression tool!
    I tried to paste the whole code, n it is showing me errors!
    :confused:
     
    farooqwani, Jan 12, 2010 IP
  2. markupdude

    markupdude Peon

    Messages:
    215
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    markupdude, Jan 12, 2010 IP
  3. mkda

    mkda Active Member

    Messages:
    139
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    mkda, Jan 12, 2010 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    CSS compression - at least in terms of before uploading it to the server is generally a waste of time - the average of 1.8 bytes per line of code saved should rarely pass 2k on even the largest of websites - hardly worth the loss of maintainability in the code.

    ... you'll get much bigger benefits setting up the server for compression, is that what you are asking for? Setting up the server to do it via .htaccess?

    If so, put this into your .htaccess file.

    <IfModule mod_deflate.c>
    <FilesMatch "\.(html|js|css)$">
    SetOutputFilter DEFLATE
    </FilesMatch>
    </IfModule>
    Code (markup):
    ... and assuming your copy of apache has the gzip module present it should auto-compress javascript, html and css transparently between your server and everybody's browser. (though you have to set up gzip manually for languages like ASP or PHP in their code)
     
    deathshadow, Jan 13, 2010 IP
  5. wwwsolution

    wwwsolution Guest

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    in the css code there has two main parts: a selector, and one or more declarations:
    <1> Selector is normally the HTML element you want to style
    like .....
    • <h1>This is a heading</h1>
    • <p>This is a paragraph.</p>
    <2> Declarations:
    Each declaration consists of a property and a value.
    The property is the style attribute you want to change. Each property has a value.
    CSS declarations always ends with a semicolon, and declaration groups are surrounded by curly brackets:
    p {color:red;text-align:center}
    tnx....
     
    wwwsolution, Jan 20, 2010 IP