Welcome Guest, Not a member yet? Register   Sign In
CSS styles not being read
#1

[eluser]adamp1[/eluser]
I'm having a slight issue with styles. I have the following:
Code:
...
body { font-size: 75%; }

/* Default fonts and colors.
   If you prefer serif fonts, remove the font-family
   on the headings, and apply this one to the body:
   font: 1em Georgia, "lucida bright", "times new roman", serif; */

body {
  color: #222;
  font-family: Arial, Verdana, Helvetica, sans-serif;
}
h1,h2,h3,h4,h5,h6 {
  color: #111;
  font-family: Arial, Verdana, Helvetica, sans-serif;
}
...
It's not the full stylesheet only a part. Now the problem is the top body is getting ignored while the second one isn't. If I combine them it works fine, but I would rather not do that just to make the stylesheet easier to upgrade.

So does anyone know why its getting ignored?
#2

[eluser]codex[/eluser]
[quote author="adamp1" date="1209238682"]I'm having a slight issue with styles. I have the following:
Code:
...
body { font-size: 75%; }

/* Default fonts and colors.
   If you prefer serif fonts, remove the font-family
   on the headings, and apply this one to the body:
   font: 1em Georgia, "lucida bright", "times new roman", serif; */

body {
  color: #222;
  font-family: Arial, Verdana, Helvetica, sans-serif;
}
h1,h2,h3,h4,h5,h6 {
  color: #111;
  font-family: Arial, Verdana, Helvetica, sans-serif;
}
...
It's not the full stylesheet only a part. Now the problem is the top body is getting ignored while the second one isn't. If I combine them it works fine, but I would rather not do that just to make the stylesheet easier to upgrade.

So does anyone know why its getting ignored?[/quote]

Works for me. You sure you're not defining a property somewhere else that might overrule this one?
#3

[eluser]adamp1[/eluser]
OK I seem to have figured where the problem stems from. But have no idea why it is happening.

Basically there are some IE only rules which seem to stop the next style rules being even in FF.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled&lt;/title&gt;
&lt;style type="text/css"&gt;
&lt;!--
html, body, div, span, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, code,del, dfn, em, img, q, dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td {margin: 0;padding: 0;border: 0;font-weight: inherit;font-style: inherit;font-size: 100%;font-family: inherit;vertical-align: baseline;}
body { line-height: 1.5; background: #fff; margin:1.5em 0; }

/* For what ever reason if you remove
   these next IE only styles the body
   style after will get applied */
&lt;!--[if IE 5]>
body        { text-align: center; }
.container  { text-align: left; }
<![endif]--&gt;

&lt;!--[if IE 6]>
* html .column { overflow-x: hidden; }
legend { margin-bottom:1.4em; }
<![endif]--&gt;

&lt;!--[if gte IE 6]>
ol { margin-left:2em; }
<![endif]--&gt;

body {
  font-size: 75%;
  color: #222;
  font-family: Arial, Verdana, Helvetica, sans-serif;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
This text should have a css style applied to it, set on line 102, but if you use<br />
firebug that style isn't applied.
&lt;/body&gt;
&lt;/html&gt;




Theme © iAndrew 2016 - Forum software by © MyBB