472,967 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,967 software developers and data experts.

Stylesheet not respected

I was able to the see weird stylesheet behavior on opera, IE and
mozilla under
mod_python. Here is some python code that exhibited the behavior. I
have the body.css in the same folder as this file and the background is

set to blue. When I access it at http://localhost/test.py, the html
page shows Hello World with no blue background.

If i view source, copy into test.html, launch it in browser, everything

is good. Does the lack of .html extension in the address bar cause
trouble?

from mod_python import apache
def handler(req):
req.content_type = 'text/html'
req.write("""
<html>
<head>
<title>Hello World</title>
<link href="body.css" type="text/css" rel="stylesheet"
/>
</head>
<body>
Hello World
</body>
</html>""")

If I inline the style, it works fine. Any ideas why this happens?

Oct 24 '06 #1
2 1119
Suren wrote:
I was able to the see weird stylesheet behavior on opera, IE and
mozilla under
mod_python.
[snip]

I'm 99% sure this has nothing to do with Python but is just an error
in your CSS file. Show the CSS so we might be able to see the problem.

One thing to check for though is that your web server is serving CSS
files with the correct content type (text/css and not text/plain or
somthing equally silly).

--Irmen
Oct 24 '06 #2
It was nothing related to python but how my httpd.conf was setup.

My apache conf was set to handle files under this.

<Directory "C:/Program Files/Apache Group/Apache2/htdocs/test">

When I said href="body.css", it was looking under test\body.css. My
project src was way deeper and I was assuming that it would like for
the css file where the python source is.

I am sure this is a newbie gotcha...
Irmen de Jong wrote:
Suren wrote:
I was able to the see weird stylesheet behavior on opera, IE and
mozilla under
mod_python.
[snip]

I'm 99% sure this has nothing to do with Python but is just an error
in your CSS file. Show the CSS so we might be able to see the problem.

One thing to check for though is that your web server is serving CSS
files with the correct content type (text/css and not text/plain or
somthing equally silly).

--Irmen
Oct 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sarah Haskins | last post by:
I have a few questions about this problem I'm having involving XML, DTD, and XSL. I'm working with this DTD which defines a stylesheet, as such... <?xml version="1.0" encoding="UTF-8"?>...
1
by: Steven An | last post by:
I'm gonna describe the situation I'm dealing with..but if you're not interested, just skip to the last line where I bluntly ask my question :) Here's my scenario: I've got a huge website that...
4
by: Catherine Lynn Smith | last post by:
OK, I am learning my way around the new DOM, but I am still at a loss on finding a few things. I have an HTML document that links to a stylesheet. /* START STYLESHEET EXAMPLE */ /*...
5
by: David Trimboli | last post by:
I'm writing HTML 4.01 and CSS 2 pages that include a CSS-driven pop-up menu. What I'm trying to do is create a screen style that uses the menu, links, etc. normally, and a print style that removes...
7
by: pintihar | last post by:
Hi, As a follow on from an earlier post I have another question about xslt. Is it possible to create the stylsheet programatically? Is this sensible? In the first phase I needed to map element...
0
by: barney.b | last post by:
Hi, I'm trying to pre-process an XSL stylesheet with another stylesheet, before using the result to transform an XML document. i.e.: stylesheet(xsl) --> preprocessor(xsl) --> temp(xsl)...
3
by: gdelfino | last post by:
I have an XML file which I transform into XHTML using stylesheetA.xsl. I also have stylesheetB.xsl which transforms my XML file into an Excel XML document. As both Excel and most new browsers...
1
by: Dave Rado | last post by:
Hi A while ago I discovered a way of creating css pseudo-frames, that offer users the important benefits of real frames (i.e. the navigation remains visible when you scroll down the page), but...
3
by: =?iso-8859-1?Q?Daniel_Lidstr=F6m?= | last post by:
Hello! I have a strange problem with my pimpl implementation. What happens is that const correctness is not respected. Let me go straight to the code: #include <iostream> struct Geometry...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.