Omigod- my page content is being overrun with CSS!

Discussion in 'CSS' started by billiardsblogger, Feb 11, 2007.

  1. #1
    Help me please... I'm in dire need of advice.

    I've heard many times that it is a good practice to bring your content up to the top of the page whenever possible. Evidently search engine spiders don't like it when you bombard them with lots and lots of CSS or metatag info before letting them see the actual page text.

    Check out my blog - www.billiardsblogger.com - for an example of what NOT to do in regards to this principle.

    For some reason ALL of my CSS file is being displayed on EVERY page before the content is appearing.

    Help! How do I remove this CSS content? Is their a simple way to only have the CSS referenced when necessary?

    Thanks in advance for any help!
    billiardsblogger
     
    billiardsblogger, Feb 11, 2007 IP
  2. unitedrokz

    unitedrokz Peon

    Messages:
    86
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    yes you can and its very easy mate....

    just create a seperate css file (ie. create a file in notepad call style.css) and cut and paste all of your css code into that file.


    then all you need to do is at this one line of code in the head section of your web pages

    <link href="style.css" rel="stylesheet" type="text/css" />

    you will not need to change anything else further down the page.... the rest of the page will now look to that css file for all the info it needs...just make sure to obviously upload the css file to your directory as well
     
    unitedrokz, Feb 11, 2007 IP
  3. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #3
    CSS and JavaScript code should be in external files whenever possible. Not only does this have a direct (and positive) effect on how the search engines parse your code, but they will also improve your download times as well, since the browser will be able to cache the file for later re-use.
     
    Dan Schulz, Feb 12, 2007 IP