cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with CSS files when placed in multiple locations.

Former Member
0 Kudos

Hi,

In our application we have a folder structure for the code files. Folder structure looks something like the one shown below:

ABC

---Scripts

---Stylesheets

DEF

-


Scripts

-


Stylesheets

Common

---Scripts

---Stylesheets

The problem is, if we create a CSS file and place it in its module specific folder (Eg: ABC) to which it belongs to and call the CSS on a page, then the styles are not getting applied to the page. But if we move the stylesheet to the Common folder, then page renders properly. In common folder, we already have a common CSS which is used across the project.

Facing similar problem with module specific and common js files.

We have to move all the module specific files to the module folders and all the common files to be placed in the Common folder.

MII Version: 11.5

Please help!

Regards,

Rajesh.

Accepted Solutions (1)

Accepted Solutions (1)

jamie_cawley
Advisor
Advisor
0 Kudos

Try clearing out your browser cache too.

Jamie

Former Member
0 Kudos

Hi Rajesh,

I totally agree with Adarsh.

Also, if style Classes in two different CSS files has the same names, then it might could create problems. Make sure you have unique names for all the classes.

Thanks,

Nishad.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi All,

Finally solution for this problem is found.

Its the inconsistent settings of the IIS for the directory settings which is causing this problem.

The 2 important things are that 1: the u201CReadu201D item is checked, and 2: That the execute permissions be set to u201CScripts only.u201D Leaving the checkbox unchecked or the execute permissions set to u201Cnoneu201D inhibits browser clients from obtaining access to the referenced files.

Regards,

Rajesh.

Former Member
0 Kudos

Hi,

Just reframing my question....

I have an application structure that Iu2019ve inherited from prior developers. It looks something like this, where ABC and DEF are app modules:

ABC

---Scripts

---Stylesheets

DEF

-


Scripts

-


Stylesheets

.irpt pages are located in the module directory. Javascript (.js) files are in the Scripts sub-directory, and stylesheets (.css) are in the Stylesheets sub-directory. Iu2019ve created a new module with the same structure

NEW

-


Scripts

-


Stylesheets

IIS / MII sees the .irpt files in the new module just fine, but any .js and .css files I put in the new sub-directories are not seen (I get errors when attempting to access .js file content and .css styles are not applied to the page). Put the file in the same directory as the .irpt u2013 not seen. Move the file to any existing directory (i.e. for another module) and IIS / MII sees it.

Is there some kind of configuration addition/change I need to make? I created a simple .html page with .js and .css references in the new sub-directories. No problems. So Iu2019m thinking IIS is not the issue. I also tried restarting MII and restarting the server.

Weu2019re using xMII Version 11.5

Regards,

Rajesh

Edited by: rajgudipati on Jul 14, 2010 4:29 AM

sidnooradarsh
Contributor
0 Kudos

Please post the error you getting and also post how are you linking/including the js and css files in your html/irpt page the path

I guess its problem with path

sidnooradarsh
Contributor
0 Kudos

Hello Rajesh,

Check for the two things,

1) Proper File Path of CSS

2) Does style Classes in two different CSS files has the same names?

Then resolving names could be a problem too.

Hope this helps!!

Regards,

Adarsh

sidnooradarsh
Contributor
0 Kudos

Rajesh,

Also note that, If your html is referencing to multiple css files then the last referenced CSS file style classes will override all the style class having same names in the previous css files.

for example,

say CSS1 has


.bodycolor
{
background-color:yellow;
}
.button
{
color:red;
}
h1
{
font-size:50pt;
}

and CSS2 has


.bodycolor
{
background-color:red;
}
.button
{
color:yellow;
}

And your HTML is,



<html>
<head>
<link rel="stylesheet" type="text/css" href="css1.css"/>
<link rel="stylesheet" type="text/css" href="css2.css"/>
<title>CSS Test</title>
</head>
<body class="bodycolor">
<h1>Hello World</h1>
<input type="button" class="button" name="B1" id="B1" value="      Click         " size="50">
</body>
</html>

In this case the classes "bodycolor" and "button" will be overridden by css2 file but h1 will be taken from css1

Hope this helps!!

Regards,

Adarsh