6 replies [Last post]
co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 12 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Check out this example page: http://pub.c-o2.net/address.htm

Notice that the address tag is contained within the paragraph tag. However, even though it has a display: inline; style, it is still acting like a block element.

Now, view source in either browser. All seems okay, but, in Firefox, select all the text on the page and right-click, View Selection Source... the address tag has been moved outside of the paragraph tag!!

Anyone encountered this before? I've done some research and it seems the address tag has a bit of an incompatibility history.

The next sentence is true. The previous sentence is false. Discuss...

Tags:
Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Address element madness

Very interesting and slightly twilight zone ish, never seen that happen before.

Wonder if anyone has an explanation for it.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 18 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Address element madness

Have you considered that a <p> may not contain an <address>?

Just because you want to display as inline does not make it an inline element. Maybe Moz was just looking out for you Smile

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 12 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Address element madness

I don't think that's the issue. IE is also doing the same thing, and we know that does definitely not look out for us! :roll:

There's very decent sematic reasons for wanting an inline address tag.

This has to be a bug?

The next sentence is true. The previous sentence is false. Discuss...

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 3 weeks 6 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

Address element madness

Hi c02,
Strange.
I haven't played around much with address tags before.
It acts as if the p was closed before the address starts.
If you put borders around the p and address and add text after the address you can see it is acting as an inline element it just that the browser, firefox in my case, seems to think the paragraph is closed.

Anonymous
Anonymous's picture
Guru

Re: Address element madness

co2 wrote:
Notice that the address tag is contained within the paragraph tag. However, even though it has a display: inline; style, it is still acting like a block element.
define the p element as display:inline; as well and see what you get.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 18 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Address element madness

Tony wrote:
Hi c02,
Strange.
I haven't played around much with address tags before.
It acts as if the p was closed before the address starts.
If you put borders around the p and address and add text after the address you can see it is acting as an inline element it just that the browser, firefox in my case, seems to think the paragraph is closed.
If you open the DOM inspector, you'll see that's exactly the case. The same type of thing happens if you place the <style> element in the body; Firefox will move it (internally) to the head.

If you view the source of a selected area, it reflects the correction.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.