SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: CSS in DW

  1. #1
    SitePoint Zealot dkilburn's Avatar
    Join Date
    Jul 2000
    Location
    Inyokern, CA
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got a style sheet I would like to apply to a template in Dreamweaver. How do you link the sheet to the template?
    Debby Kilburn
    "With computers, everything is possible, but nothing is easy"
    AIM: fourhweb

  2. #2
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Open the stylesheet in for example Notepad, highlight the text, copy it. In DW, open the template and select View > Head Content. You can now paste the stylesheet into the head of the template.

    Hope this helps.
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  3. #3
    SitePoint Zealot dkilburn's Avatar
    Join Date
    Jul 2000
    Location
    Inyokern, CA
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Elledan. I was hoping you'd drop by and help out. Can you link to the stylesheet externally or does it have to be in the template document itself?
    Debby Kilburn
    "With computers, everything is possible, but nothing is easy"
    AIM: fourhweb

  4. #4
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It can be in the template itself, although you can link to it externally (using SSI), which is something I've used with my EmuDreams site. But since it's in a template, I would rather have it in the template itself.
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  5. #5
    SitePoint Zealot dkilburn's Avatar
    Join Date
    Jul 2000
    Location
    Inyokern, CA
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, so now I've added the style info into the template. I had to use an absolute url for the background or msie wouldn't show it (or netscape - one or the other). Now that all works.

    The problem is that 2 of the images in the template won't display, even though they show up okay when I am working on the files in DreamWeaver. I've checked to make sure the files are in the right place, etc., but can't figure it out. The files start at http://www.goatweb.com/beta/index.shtml The template is http://www.goatweb.com/beta/templates/default.dwt. When I open up the template the pics show. :-(

    I'm sure this is something simple, I'm just toast!
    Debby Kilburn
    "With computers, everything is possible, but nothing is easy"
    AIM: fourhweb

  6. #6
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you tell me where you keep the images and files? Are they all in one folder?

    Oh, and double check the URL's to the images
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  7. #7
    SitePoint Zealot dkilburn's Avatar
    Join Date
    Jul 2000
    Location
    Inyokern, CA
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I loaded all of the pages directly into the root folder instead of the beta subdirectory and everything seems to work. Not sure what is going on, but at this point I'm not complaining.

    Until all the bugs are worked out, I've got 2 parallel sites, one at http://www.goatweb.com/index.html and the other at http://www.goatweb.com/index.shtml.

    Thanks for the help!
    <Edited by dkilburn on 11-27-2000 at 02:32 AM>
    Debby Kilburn
    "With computers, everything is possible, but nothing is easy"
    AIM: fourhweb

  8. #8
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Debby...example:

    root/images
    root/news
    root/news/index.html

    If you are viewing index.html in the news directory and want to use an image in the images directory, then the path to the image would be ../images/imagename.jpg Why? Because you have to go UP a directory (into root) before you can go DOWN into the images directory. The ../ is the method by which you navigate the folders on a server.

    My bet would be that the path to the images (from the template) is ../images/imagename.jpg.

    Remember though that your images are not being loaded from the templates directory. They are being called from the root directory. So if your images are in root/imates, then the path to the images (from root) would be images/imagename.jpg

    You can't have both things. You can either see the images when you view the template or you can see the images when you view the overall page.
    <Edited by creole on 11-27-2000 at 11:40 AM>
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  9. #9
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good point, creole!

    I'd like to make one addition: when you define the path to the images, start from the root.

    Example:

    When you've the site in http://www.somesite.com/folder/ and you want to use the images that are in the rootfolder, then you could use ../image.gif but better would be to use /image.gif since in that case it doesn't matter where you put the HTML files; it will always find the images.
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  10. #10
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually I think the CSS should be an external file, even if the site is based on a template. Just do the <link> thing in the template, should be ok.

  11. #11
    SitePoint Zealot dkilburn's Avatar
    Join Date
    Jul 2000
    Location
    Inyokern, CA
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by duckie
    Actually I think the CSS should be an external file, even if the site is based on a template. Just do the <link> thing in the template, should be ok.
    I don't know why I didn't think of that...I've only spent about 12 hours on this thing this weekend! I made the link to an external style sheet and it works fine. The only way I can get background images to work for both netscape and MSIE in a style sheet is to use an absolute URL to the image. Relative URLs don't work in one or the other.

    Must admit, after converting the site to dw templates, I am a true believer! I hated those front page shared borders. They were almost more trouble than they are worth!

    Thanks all!
    Debby Kilburn
    "With computers, everything is possible, but nothing is easy"
    AIM: fourhweb


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •