File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes CSS Problem with XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "CSS Problem with XML" Watch "CSS Problem with XML" New topic
Author

CSS Problem with XML

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 412
Hello I have a global css which has this entry in it:


This references the individual file APAHome.xsl

When I reference the above code in the Styles.css file it tiles the background image, almost like it is not reading the statements above it.

It doesn't tile the image on the subsequent pages, it is almost like it is reading the first line and the last line and ignoring the center statements.

Do you have any suggestions?

Thanks,
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2840
    
  11

I don't think it references APAHome.xsl. The way I read this rule as applying to a body tag with the ID "APAHome" and the class "xsl". It seems likely that it's just not being applied to the page you think it should be. With Firebug, and probably other tools for other browsers, you can examine the body tag in question and see what CSS rules apply to it and where they are coming from.
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 412
Hello I have looked at this with Firebug and it says that for some reason it is not reading the 'no-repeat' in the html

the 'no-repeat' from the CSS

Also under the CSS tab in firefox, it says this:

body#APAHome.xsl {
background-image: url("/images/bg_page/APAHome.jpg");
background-position: center center;
background-repeat: no-repeat;
}

This is an application that I inherited and any thoughts you have would be most welcome,

thanks,
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2840
    
  11

Can you show the body tag you are expecting this rule to apply to? The "background-repeat: no-repeat;" looks OK to me, so I still suspect the whole rule isn't getting applied to your body element, and it's picking up the other properties from a different source.
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 412
Hello there is only one Styles.css stylesheet at the root level. So there could not be any conflicting tags.

The only thing that I wonder about is there is a BasePage.java file which says this about the background:



Could you please consider this new information and let me know your thoughts?

Thanks,

Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2840
    
  11

Well, I'd say that body tag wouldn't get the rule applied to it. However, I'd prefer to see the rendered HTML to the Java code. Can you go into Firebug (or just view source) and cut out the body tag you find there and paste it in here?

Also, if you're in Firebug, you can select the body tag and see what rules apply to it. To the right of the each rule, it will tell you where that rule is coming from.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You think that CSS rule means: on a page with the filename of APAHome.xsl, apply thefollowing to the body tag. It has NOTHING to do with a file name, css has no knowledge of file names.

As Greg has already mentioned, the rule is saying




It is looking for this



So unless you have markup like that in your page, that CSS rule is not going to do a thing.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CSS Problem with XML
 
Similar Threads
JSP with CSS does not display the background image
Programmatically alter MSIE tools/internet option setting
Setting Background image
Drawing a Transparent PNG
Is It Possible to Provide FIELDSET with Background Color?