Jim Dabell <ji********@jimdabell.com> wrote in message news:<hR********************@giganews.com>...
Alex Peng wrote:
I have the following code. For IE 6, I can get link one and link two
in two separated lines, but not in Netscape 7. I try to set
display:block for A.ccMenu; however, the hyperlink excess ccMenuBox
boundary.
I'm not sure what you mean by this. You want <a> elements on separate
lines, setting them to block display sounds reasonable. If you have
trouble with the width, then check your margins and padding.
Netscape 7 should have better css support; however, it just give me
headache sometime.
Any suggestion?
Thanks in advace.
Alex
----------------------
<html>
[snip]
You aren't going to get better CSS support if you don't supply a doctype.
Look into "quirks mode" and "doctype switching". Browsers will
intentionally get your CSS wrong with a document like this.
All bets are off as far as CSS is concerned until you have valid HTML. I
have better things to do than to track down obscure behaviours in error
conditions, and I'm guessing you do too. Let the computer do a bit of the
work for you.
<URL:http://validator.w3.org/>
I modified the previous code as below and passed w3 validator.
This time I put text-indent instead of padding. Looks good, but not
what I want.
I really need the padding-left and padding-right for ccMenu; however,
ccMenu exceeds 150px if I add padding.
I doubt this is a bug of Netscape/Mozilla.
Alex
---------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1">
<title>Untitled</title>
<STYLE type="text/css">
..ccMenuBox {width:150px;border:1px solid black;background:yellow}
A.ccMenu {display:block;text-indent:10px;background-color:yellow;
width:150px;}
A.ccMenu:hover {background-color:white;}
</STYLE>
</head>
<body>
<DIV class="ccMenuBox">
<A href="#" class="ccMenu">Link one</A>
<A href="#" class="ccMenu">Link Two</A>
</DIV>
</body>
</html>