views:

55

answers:

1

i am converting over a website and using the same .css files.

its really strange as the site looks slightly different in terms of formatting (font sizes, padding, spacing, etc . )

does this make any sense because i am using the same stylesheets.

is there anything that asp.net webforms was doing that was magic. i am reviewing the actual html which is identical.

+1  A: 

Is it possible that in your old site, the ordering of the CSS files in the HTML are different?

Let's say that, in your main CSS file (main.css), you set a font size of anything inside the body tag to be 10px, and in a page-specific CS file (thisPage.css), you set the font size of anything in the body tag to be 12px.

<html>
  <head>
    <link  rel="stylesheet" href="main.css"/>
    <link  rel="stylesheet" href="thisPage.css"/>
  </head>
  <body>
  ...
  </body>
</html>

In a page rendering, the font size will be 12px. The page-specific CSS will override anything that matches a rule in the main CSS (unless of course, you apply the !important rule!).

<html>
  <head>
    <link  rel="stylesheet" href="thisPage.css"/>
    <link  rel="stylesheet" href="main.css"/>
  </head>
  <body>
  ...
  </body>
</html>

In this page rendering, the font size will be 10px.

This may be something to consider as, because these are cascading rules, the order is important.

Dan Atkinson