@import css

Posted on 2004-11-21
Last Modified: 2010-03-04
I'm currently trying to set up my mac osx 10.3 to serve pages locally.  Do i have to do anything to my httpd.conf file for @import rules to import external css documents?  I've read something about setting it up for server side includes, but i'm not sure @import is similar.  anyway, @import isn't working (inline is), and i have no idea why.  works everywhere else.

here's index.htm:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en">
            <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
            <title>Welcome to ACA</title>

            <style type="text/css" media="screen">@import url(css/layout.css);</style>

body {background-color: red;}

Question by:bradnoble
    LVL 1

    Expert Comment

    As far as i know you don't need to set-up anything in the httpd.conf.
    Could it be that the path is not readable? What happens when you enter the url of the stylesheet into the address bar of the browser? Do you get the stylesheet?
    The only thing that i can think of which could be influencing the stylesheet is the default type of documents
    More info about the default type


    Author Comment

    Thanks for your response.  When I enter the URL for the stylesheet, I get an Apache "Forbidden" message, where I don't have permission to access the file on this server.  Strange.  Any thoughts?
    LVL 1

    Expert Comment

    Could be that the rights on the file/dir are not correct. The dir and file needs to be accessible by the apache user. You could set the rights on the file and dir to have execute and read rights for everyone. The file should be accessible then.
    On unix this corresponds with num val 755

    Author Comment

    patrick, where in osx do i make this change you're suggesting?  in the terminal?  or, system prefs?  (i'd like all files and dirs in and below my Web Server > Documents (root) to have execute, read and write -- this is my dev server.)

    LVL 1

    Accepted Solution

    as far as i understand osx is practicly BSD so you could do it via a terminal session.
    Do the following:
      open a terminal
      go to the directory where you files are located (cd <dir>)
      change the rights with chmod -R 755 *
      chmod is a command to change the rights on files (change mode), 755 tells it to use as mask owner everything (7) group read and execute (5) other read and execute (5). The -R makes the command recursive so it will travel all dirs and change the rights accordingly.

    Another option would be to open a graphical file manager and do it from there.

    If you want more info about the chmod you could probably type in a terminal "man chmod"


    Author Comment

    patrick -

    bless you, man.  this seems to be the fix i needed.  thanks!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
    If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now