This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > November 2006 > Re: Is my explanation right?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Is my explanation right?
Harlan Messinger

2006-11-19, 7:35 pm

hantechs@XXXXXXXXXX wrote:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <body>
> <a href="">a href</a>
> <a>
> <button style="display:block;">a button</button>
> </a>
> </body>
> </html>
> According to the rending result, I tried to explain: block-level
> element <button> generates a block box, and according to the containing
> block's definition in css2.1 spec, it's containing block should be the
> block box generated for <body> element; Because a containing block can
> only contain either block boxes or inline boxes, two anonymous block
> box should be generated, each wrapping a inline box generated for <a>
> elements, so the button box's containing block should be the anonymous
> block box, right? and what is the second <a>'s inline box? Does it
> contain the button's block box?


Your code is invalid, so, as is, there's no point trying to analyze the
"correct" handling of it. First, you're missing a HEAD tag, which has to
have a TITLE tag inside. Second, in Strict mode inline elements aren't
allowed directly inside the body.

hantechs@gmail.com

2006-11-19, 7:35 pm

I modified the code, and now it passed the w3c's validation. Thanks.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml" xml:lang=3D"en" lang=3D"en">
<head>
<meta http-equiv=3D"Content-Type"
content=3D"text/html;charset=3Dutf-8"></meta>
<title></title>
</head>

<body>
<p>
<a href=3D"ahref">a href</a>
<a>
<button style=3D"display:block;">a button</button>
</a>
</p>
</body>
</html>

"Harlan Messinger =D0=B4=B5=C0=A3=BA
"
> hantechs@XXXXXXXXXX wrote:
>
> Your code is invalid, so, as is, there's no point trying to analyze the
> "correct" handling of it. First, you're missing a HEAD tag, which has to
> have a TITLE tag inside. Second, in Strict mode inline elements aren't
> allowed directly inside the body.


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews