Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CAn anyone please explain whats happening?

1 view
Skip to first unread message

Robert Prins

unread,
Jan 18, 2021, 4:26:58 AM1/18/21
to
https://prino.neocities.org/sandbox.html

The first four lines use <br><br> the last four <p>

Why, on the <p> lines doesn't get <details> inlined???

Robert
--
Robert AH Prins
robert(a)prino(d)org
The hitchhiking grandfather - https://prino.neocities.org/indez.html
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html

Arno Welzel

unread,
Jan 18, 2021, 5:53:12 AM1/18/21
to
Robert Prins:

> https://prino.neocities.org/sandbox.html
>
> The first four lines use <br><br> the last four <p>
>
> Why, on the <p> lines doesn't get <details> inlined???

Because this is a block element like <table> or <blockquote> and not an
inline element like <em>, <img> etc..

Also see
<https://html.spec.whatwg.org/multipage/interactive-elements.html#the-details-element>


--
Arno Welzel
https://arnowelzel.de

Jukka K. Korpela

unread,
Jan 18, 2021, 6:23:13 AM1/18/21
to
Arno Welzelwrote:

> Robert Prins:
>
>> https://prino.neocities.org/sandbox.html
>>
>> The first four lines use <br><br> the last four <p>
>>
>> Why, on the <p> lines doesn't get <details> inlined???
>
> Because this is a block element like <table> or <blockquote> and not an
> inline element like <em>, <img> etc..

To put it more explicitly, the <details> tag for that reason implicitly
closes the open <p> element, as if the markup were
<p>x. This is a </p><details ...>...
And text after the closing </details> tag is just “loose text”, text
directly inside the <body> element, and not part of any <p> element.
This happens when the browser parses the HTML code, so you cannot affect
this in CSS.

If you wish to have both text and a <details> element inside a
paragraph-like container, don’t use <p> but a <div> element with a
suitable class, and style it like a paragraph.

0 new messages