Space round images

S

Spartanicus

Steve Pugh said:
I don't see anything pertaining to the img element there. Can you
point us at a more specific passage?

I'm said:
If I set img {border: 10px solid red;} then I would expect that border
to be applied to the img element regardless of whether that element
contained a graphic or alt text.

A matter of opinion since it's not in the spec. I consider this
incorrect behaviour.

The ambivalence arises from a leftover shortcoming in the img construct,
using an object construct removes the ambivalence about how it should
behave:

<object data="picture.gif" type="image/gif" style="border:2px solid
red">Picture</object>

If the UA renders the text then it should render it sans border as
border is not an inheritable property.

I therefore submit that it is reasonable to apply the same expectation
to a situation where the <img> construct is used, but as I said, it's a
matter of opinion as it's not governed by the spec.
 
G

GD

Spartanicus said:
You know that it pertained to GD's example using <p> and a <span>

That example was an analogy of just why styles should be applied to an
inline image and its alt text - just like any other element, which was
the point. But you said this was "Incorrect behaviour".

it's not in the spec. I consider this incorrect behaviour.

An image element is just a box and is thus subject to styling. Otherwise
how else could you remove the blue border around linked images if you
weren't allowed to apply them in the first place?

The words 'straws' and 'clutching' spring to mind :)

Either way, if I apply styles to images they work in all my browsers.
 
S

Steve Pugh

Spartanicus said:
You know that it pertained to GD's example using <p> and a <span>,

No, I didn't know that. If I'd known that then I wouldn't have asked
the question.
I'm not in the mood to play silly games with you.

Ah, name calling. Always a good sign.
A matter of opinion since it's not in the spec. I consider this
incorrect behaviour.

Do you think the img element stops existing if it is rendered via the
alt text rather than via the image?
The ambivalence arises from a leftover shortcoming in the img construct,
using an object construct removes the ambivalence about how it should
behave:

<object data="picture.gif" type="image/gif" style="border:2px solid
red">Picture</object>

If the UA renders the text then it should render it sans border as
border is not an inheritable property.

But the object element is still there, it hasn't vanished just because
it's non-replaced content is being displayed rather than it's replaced
content. There should be a border round the object element, and if the
text is the only child of the object element then the border must go
around the text.

To say that this is a matter of inheritence is implying that there is
some invisible child element of object around the text. Even if that
were the case the border would still be rendered on the object itself.

Steve
 
S

Spartanicus

Steve Pugh said:
Ah, name calling. Always a good sign.

Where did I call you names?
Do you think the img element stops existing if it is rendered via the
alt text rather than via the image?


But the object element is still there, it hasn't vanished just because
it's non-replaced content is being displayed rather than it's replaced
content. There should be a border round the object element, and if the
text is the only child of the object element then the border must go
around the text.

To say that this is a matter of inheritence is implying that there is
some invisible child element of object around the text.

There is, an anonymous line box.
Even if that
were the case the border would still be rendered on the object itself.

A UA parsing a nested cascade must ignore the outer elements of said
cascade until it finds a method it can render, in this case the text,
thus the object element is simply not rendered, read up on it:
http://www.w3.org/TR/html401/struct/objects.html#h-13.3

I noticed that Mozilla gets this wrong, Opera does the right thing.
 
S

Spartanicus

Spartanicus said:
There is, an anonymous line box.

On second thought inheritance doesn't apply here, if the object element
is ignored it establishes no containing block in the first place.
 
A

Andrew Glasgow


Indeed I did, but I'm still at a loss to understand your claim that it
would be "Incorrect behaviour" for the alt text in the following example
to be red and not blue (when rendered) given that there are "CSS styles
specified for img"

<p style="color:red">
Round the ragged rock, the
<img src="dr.gif" alt="Dizzy Rascal" style="color:blue">
ran.
</p>
[/QUOTE]

It seems to me that since the alt text is a *part* of the img element,
it should be styled with the blue. However, if I understand the
discussion and the specs correctly, if you instead used

<p style="color:red">
Round the ragged rock, the
<object data="dr.gif" type="image/gif" style="color:blue">Dizzy
Rascal</object> ran.
</p>

then Dizzy Rascal should not take on the color of the object style.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,117
Latest member
Matilda564
Top