Forum Moderators: not2easy

Message Too Old, No Replies

IE 6.0 ignores rules?

         

sbt1

6:35 pm on Jul 13, 2004 (gmt 0)

10+ Year Member



Just learning here. I have my rules in an external file.

Some rules work just fine, others don't (IE ignores them).

Contents of the rules file:
H1 { color: darkblue; font-family: arial; font-size: 14pt; }
H2 { background: silver; color: red; font-family: arial; font-size=12; font-weight:bold; width: 120px; }
H3 { background: silver; color: blue; font-family: arial; font-size=12; font-weight:bold; width: 120px; }
H4 { background: silver; color: orange; font-family: arial; font-size=12; font-weight:bold; width: 120px; }
H5 { position: absolute; left: 82px; top: 6px; color: green; font-family: arial; font-size=12; font-weight:bold; width: 120px; }
H6 { background: darkblue; color: white; font-family: arial; font-size=12; font-weight:bold; width: 120px; }
H7 { background: red; color: white; font-family: arial; font-size=12; font-weight:bold; width: 120px; }

H7 is the one that is ignored. If I rename it or define another one with a different name, still no dice.

Here's the html:
<HTML>
<HEAD>
<TITLE>SDXCSS</TITLE>
<LINK REL=stylesheet HREF="sdxcore.css" TYPE="text/css">
</HEAD>
<BODY>
<H1>Test Page</H1>
<HR color='darkblue'>
<BR>
<IMG SRC="c:\program files\sdx\key.gif">
<H6>Resource:</H6>
<H6>Mon 07/12/2004</H6>
<H7>Tue 07/13/2004</H7>
<H6>Wed 07/14/2004</H6>
<H6>Thu 07/15/2004</H6>
<H6>Fri 07/16/2004</H6>
<H6>Unassigned</H6>
<H5><I>3.2</H5>
</BODY>
</HTML>

What's wrong here? Seems like I can add a rule or two, then after that they get ignored.

RammsteinNicCage

6:45 pm on Jul 13, 2004 (gmt 0)

10+ Year Member



I thought the h's only went up to 6. Are any other browsers picking up h7?

Jennifer

sbt1

6:47 pm on Jul 13, 2004 (gmt 0)

10+ Year Member



I thought the rule ID, "Hx" in these cases, was arbitrary? Maybe not.

If not, where is the list of names I can use?

RammsteinNicCage

6:51 pm on Jul 13, 2004 (gmt 0)

10+ Year Member



Is this what you're looking for? [w3.org...]

Jennifer

RJell

6:53 pm on Jul 13, 2004 (gmt 0)

10+ Year Member



The "H"s do only go up to 6, according to w3.org...but interestingly enough, Mozilla seems to honor "Custom" tag definitions in CSS.

sbt1

7:01 pm on Jul 13, 2004 (gmt 0)

10+ Year Member



Ok, so you're telling me I can't simply make up my own identifiers (like zz1, w78, rr3)? I can only use the standard H1, H2, p, etc.?

That would explain the examples I've seen so far.

But surely limits what we can do, does it not? Suppose I need 30 or so identifiers?

RammsteinNicCage

7:08 pm on Jul 13, 2004 (gmt 0)

10+ Year Member



Can you use classes and ids?

Jennifer

sbt1

7:12 pm on Jul 13, 2004 (gmt 0)

10+ Year Member



I guess, like "p.my_toplevel", "p.my.leftcolumn", etc.?

createErrorMsg

7:57 pm on Jul 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Rammstein is right. To make your own selector, create an ID (for one time use) or a class (for multiple use).

ID's are preceded by a # in the css...

#top {
color: #000;
text-align: left;
}

...and entered in the html like this...

<p id="top">

...Classes are preceeded by a . in the css...

.top {
color: #000;
text-align: left;
}

...and entered in the html like this...

<p class="top">

The header classes only go up to H6 and are, technically, only supposed to be used for indicating document headings and sub-headings (article titles, for instance, and sub-titles that logically divide up the content). If you're using the H tags to determine appearance only (as opposed to logically dicing up the content) you're better off using ALL IDs and classes.

Farix

8:44 pm on Jul 13, 2004 (gmt 0)

10+ Year Member



But surely limits what we can do, does it not? Suppose I need 30 or so identifiers?

Then you use the id attribute as you should have in the first place. H* tags are header levels--such as header, sub-header, sub-sub-header, etc. It takes an extremely extraordinary case for anyone to need more then 6 levels of headers.

Hester

9:14 am on Jul 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, so you're telling me I can't simply make up my own identifiers (like zz1, w78, rr3)? I can only use the standard H1, H2, p, etc.?

What you're talking about are the standard HTML tags. These are a fixed list. So there are only six headers, for instance.

What you need is XHTML. This allows you to add your own tags, using a "custom doctype". However, only browsers like Opera and Mozilla will style them. (IE6 is too dumb.)

Otherwise you cannot make up your own tags. If you need a seventh header (and I have seen a site that does) it needs to be defined in XHTML. To do that is quite complex.

The easiest way, which will also work in all browsers, is to use an existing tag that will do the same job. Eg:


<html>
<head>
<style type="text/css">
#h7 {font-size:12px;}
</style>
</head>
<body>
<div id="h7">This is a seventh header.</div>
</body>
</html>