CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 31st, 2004, 03:53 PM
roypython roypython is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 71 roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 5
Binding external css to a page

Hello.
I appreciate your help very much, (the subject might or might not be
directly replated to python(I realy don't know what's it related to))
Binding external css (the basic CSS1 standard) file to an html doesn't work.
[ It does work if the styles definitions are embedded in the page itself ]
I'm using apache on linux and I tried 2 browsers ( mozilla 1.5-3(debian) and konqueror 3.1.5 )
I'm using the very simple example which doesn't work

#!/usr/bin/python
print 'Content-Type: text/html\n\n'
print '''<html>
<head>
<link href="jazzy.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1> hello </h1>
</body>
</html>
'''

and the css file ( jazzy.css) looks like
h1 {color: yellow;
background: yellow;
}
p {margin-left: 20px}
body {background: red;
color:red
}


Both files are in the same virtual directory and both have full permissions(rw) for everyone.
I Idon't have an idea what the problem is.
Thanks a lot
Roy

Reply With Quote
  #2  
Old April 14th, 2004, 12:31 PM
Bladsy Bladsy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 Bladsy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Are you running this as a CGI script?
I once had the same problem with a JPG.
After tail'ing apache's error_log I noticed it was
trying to execute the jpg as a script.
You might have the same problem.
Try placing the CSS in the root of your webserver and using
<link href="/jazzy.css" rel="stylesheet" type="text/css" />

Best of luck!

Reply With Quote
  #3  
Old April 15th, 2004, 11:33 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
I dont really see why Python/CGI in general could effect wether a style-sheet is linking to the page properly; one handy thing you can do when working like this is to check the pages source code to make sure everything is being outputted correctly.

Also, i can't help knowtice that your using xhtml but have no DTD at the top?

You might also want to look at the Python section of this page for handeling Content-Type headers for XHTML:

http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #4  
Old April 16th, 2004, 01:37 AM
roypython roypython is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 71 roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 5
Problem solved

thanks a lot guys.
The problem is that Apache is trying somehow to execute every file
that is in it's virtual directory, therefore, files like jpg, css will
not be showed properly ( and sometimes will write in the apache's error log file, that it's trying to execute....)
, the solution is to move the files out
of the apache virtual directory
Mark, thanks for the remark, I had some trouble finding good documentation about how to use modules that can validate xml with dtd/ schema, but i'll keep on looking.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Binding external css to a page


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT