CSS offline for personal use?

Discussion in 'CSS' started by 24788, Jun 7, 2010.

  1. #1
    I am trying to use CSS off line for personal use to view own changes since I don't have a server to use currently. The problem I am getting is that my html works fine, but my CSS won't show up.

    I have it implemented correctly to what the book says to do, but the book tells me I need to upload it to my site/server for it to work. I am directly linking it to the file on my computer, but do I need to link it to an actually site online since I'm using an href tag?

    Anyone know a good css uploader that I can use as a temp option where it stores the file for you, so you can just link to it that way?
     
    24788, Jun 7, 2010 IP
  2. Masteroa

    Masteroa Peon

    Messages:
    54
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your CSS should work offline too.


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

    What's at your href input? If it's just like above, be sure the CSS-file is in the same folder as your html-file. If it's in another folder (named css for example) within the root folder, change it in href="css/style.css", or whatever your files and folders are named. If it still doesn't work, please provide us with the code and a screenshot of the saved files so we can help you out.
     
    Masteroa, Jun 7, 2010 IP
  3. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #3
    Just sick all the sites files in a folder, an then it should work fine. If the index file and rest of the sites html files aswell as the css file is in the same folder and you have named it correctly in the link to the css file then it should work fine.

    You know you can setup a local server aswell anywayz?

    XAMPP makes it very easy to setup a local server with PHP and SQL built in, but you only really need to setup a local server if you want to do some programming like PHP or somthing, testing basic html and css can be done without a local server.
     
    johneva, Jun 7, 2010 IP
  4. 24788

    24788 Peon

    Messages:
    529
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    My href file is from the c: drive and it's the actually direct link to the file.

    c: users / blah / blah / CSS.css

    HTML
    <!DOCTYPE html PUBLIC "-//W3C//
    DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/
    xhtml1-Transitional.dtd">

    <html xmln="http://www.w3.org/1999/xhtml">

    <head>
    <link rel= "shortcut icon" href= "http://i297.photobucket.com/albums/mm221/24788/favicon.jpg" type"image/x-icon" />


    <!--THIS IS JUST A COMMENT-->

    <meta http-equiv="content-type"
    content="text/html; charset=utf-8" />

    <title>Minnesota Twins</title>

    <link rel="stylesheet" type="text/css"
    href="C:\Users\Legit\Desktop\CSS.css" />

    </head>


    <body>
    <img src="http://i297.photobucket.com/albums/mm221/24788/Target-Field-New-Twins-Stadium-Phot.jpg"
    align="left" width="575" height="400" alt="Minnesota Twins - Target Field" />
    <div id="toc" title="3 areas to focus on"><a href="http://fitnessthatsfun.com/"> Fitness </a>
    <br />Health
    <br />Nutrition
    </div>

    <pre>
    $doubles coded$
    </pre>


    <div id="gaudi">

    <h1 id="ownage">Ownage</h1>

    <blockquote cite="http:www.fitnessthatsfun.com">

    <p>If you want to learn how to get owned at call of duty mw2 please feel free to contact me.</p>
    <p>thank you for your time</p>

    </blockquote>

    <div class="works">
    <h2 class="winone">Burnt</h2>
    <p>buzzin my <span class="emph">words here</span></p>
    </div>


    <div class="works">
    <h2 class="winone">Merked</h2>
    <p>buzzin more <span class="emph">words down here</span></p>
    </div>


    </div>


    </body>


    </html>


    CSS
    img
    {border: 4px solid red;}
     
    24788, Jun 7, 2010 IP
  5. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What Masteroa posted is the proper way to do it, but if you must have the stylesheet somewhere that is not a subfolder then try this:
    <link rel="stylesheet" type="text/css" href="file://C:\Users\Legit\Desktop\CSS.css" />
    Code (markup):
    BTW, I'm not sure if it's file:/ or file:// or file:/// cause they all work for me. :confused:
     
    Cash Nebula, Jun 7, 2010 IP
  6. PFCritics

    PFCritics Peon

    Messages:
    107
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Cash's method for a file not in a subfolder should be correct. To make things easier on myself, I usually open the actual CSS file in my browser (File > Open). Then, I go up to the address bar and copy+paste the location.
     
    PFCritics, Jun 7, 2010 IP
  7. 24788

    24788 Peon

    Messages:
    529
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks guys. I don't know if you noticed that I uploaded my picture to photobucket since that wouldn't work.

    File is what I need to remember from now on since that's the only part that doesn't come with the object title, but it's so easy.

    I really fear when I start to learn php. I need to get rid of that line now that I know it works since it's so ugly. Thanks again though first problem I've had and the first time I got around it, but I'm glad I understand this now.

    couple extra questions
    1. Are the class tags what you use to put 10 last posts on the front page? Then do you make the first page and the rest of your blog different since all you need is a content layout page once you got the main page figured out?

    2. Anyone got a good php book? I won't be using it for a while, but any suggestions before I start would be great. Thank you for your time.
     
    24788, Jun 7, 2010 IP
  8. johagulo

    johagulo Peon

    Messages:
    879
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Nah, make sure you import the css correctly and that it is in the same html folder
     
    johagulo, Jun 12, 2010 IP
  9. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #9
    Answer to your question number 1 is no if I am understanding you right, to get the last 10 posts on the first page on a blog you would need some server side programming and a database, such as PHP and mySQL to do this. Although if your simpley looking to make a blog then there are loads of different bloging scripts already available such as Wordpress (Biggest most well knowen one), there are then also loads of different templates and addon's to give extra functions ect. This will save you having to code your own php and setup database table.

    As for number 2, to be honest due to PHP changing all the time I think books are very limited in there use as they are out of date very quickly, I prefer online content myself. When your first starting I find the videos you can get online quite handy but again you need to make sure what version of PHP the video tutorial is for, otherwise you could find yourself doing the easy stuff at the start then getting to more complicated script taking a while to make it to find you carnt get it to work due to the video is telling you the old way which wont work on the newer version of PHP.

    http://www.tizag.com/phpT/
    http://www.w3schools.com/PHP/DEfaULT.asP

     
    johneva, Jun 14, 2010 IP