CSS Problems

  • Thread starter Thread starter Deven
  • Start date Start date
D

Deven

I am new wtih CSS. I have master page on root using css. Any new child
pages created with Masterpage and save them on root works fine. As soon as I
start moving them into subfolder, css is lost and page looks horrible.
Googled it and found few things but nothing seems to work or I would say,
most of the post I read assumes you know CSS and gives you codes in bits and
pieces.

Any help appreciated.

Thanks,
Deven
 
First of all, is your CSS in an external stylesheet (a *.css file that you
link to)? The fact that the location of your pages is causing the problem
makes me think that this may have something to do with it. Otherwise, I may
need to see your actual code before I can help much more. Good Luck!
 
Nathan

it is an external stylesheet in subfolder called CSS which is on root of the
website. If I use tilda to link the css, it throws off everything on root.
ie ~/css/main.css

Here is how I have it right now and all the webpages on root display just
fine.

<link href="Css/Main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
 
Does Main.css have any URLs in it (such as references to images for
properties such as background-image)? If it does, I would try changing them
to root relative paths. For example, you might try the following:

background-image:url(/images/rainbow.gif);

Rather than:

background-image:url(images/rainbow.gif);

Notice that the only difference is the / at the beginning. I would also
suggest making the href in your link tag root relative, as follows:

<link href="/Css/Main.css" rel="stylesheet" type="text/css" />

Doing this will allow the Page to find the stylesheet regardless of the
Page's location. Hopefully this helps.
 
Nathan

I've tried your suggestion to add / in front but that did not help.

<link href="/Css/Main.css" rel="stylesheet" type="text/css" />

Any other suggestion you can think of?

Thanks.
Deven
 
I think I will need to see your actual stylesheet and directory structure
before I can give anymore help.
 
Back
Top