Hi all,
I'm not sure if this is an HTML issue or CSS issue but it's weird.
I've been working w/XML for 5+ years and it's always been true that you
can use a shorthand notation for an empty element like this:
"<fred/>" is the same as "<fred></fred>"
Well, I'm seeing a case where this is not true. Take a look at the
following two examples, if you would:
<div class='separato rBar'></div><p>hello</p>
<hr/>
<div class='separato rBar'/><p>hello</p>
<hr/>
These should be equivalent, right? It seems they are not. Firefox
v1.0.4 renders the two differently, as do IE 6 and Opera.
Here is the 'separatorBar' definition:
<style type='text/css'>
div.separatorBa r {
margin-left:-10px;
margin-right: -10px;
border:solid;
}
</style>
What have I missed here? I though the <xxx/> notation was a shorthand
for <xxx></xxx>. Is this not true> Does anyone have an explanation for
my examples above?
Thanks.
--
Tony LaPaso
I'm not sure if this is an HTML issue or CSS issue but it's weird.
I've been working w/XML for 5+ years and it's always been true that you
can use a shorthand notation for an empty element like this:
"<fred/>" is the same as "<fred></fred>"
Well, I'm seeing a case where this is not true. Take a look at the
following two examples, if you would:
<div class='separato rBar'></div><p>hello</p>
<hr/>
<div class='separato rBar'/><p>hello</p>
<hr/>
These should be equivalent, right? It seems they are not. Firefox
v1.0.4 renders the two differently, as do IE 6 and Opera.
Here is the 'separatorBar' definition:
<style type='text/css'>
div.separatorBa r {
margin-left:-10px;
margin-right: -10px;
border:solid;
}
</style>
What have I missed here? I though the <xxx/> notation was a shorthand
for <xxx></xxx>. Is this not true> Does anyone have an explanation for
my examples above?
Thanks.
--
Tony LaPaso
Comment