[uf-discuss] Inline style conflict?

Frances Berriman fberriman at gmail.com
Thu Jan 11 01:36:04 PST 2007


On 10/01/07, EC <xymox12 at hotmail.com> wrote:
> Hi there,
>
> I notice the site Theatre Studies: European Theatre
> (http://www.theatrestudies.llc.ed.ac.uk/) has been placed in the problem
> section of http://microformats.org/wiki/hcalendar-examples-in-wild due to
> the use of inline style (style="display:none") used within an img tag.
>
> Here is the code in question:
> <span class="vcard">
> <img style="display:none"
> src="http://www.theatrestudies.llc.ed.ac.uk/images/staff/scolvin.jpg"
> alt="Sarah Colvin" class="photo" />
> <span class="honorific-prefix">Professor </span>
> <span style="font-weight:bold" class="fn">Sarah Colvin</span><br />
> Email: <a href="mailto:sarah.colvin at ed.ac.uk"
> class="email">sarah.colvin at ed.ac.uk</a>
> </span>
>
> I am not sure why this has been done as:
> A) the img is part a hCard and not an hCalender, although both exist on the
> page
> B) using a correctly formatted css inline markup to hide the img from the
> browser renderers cannot, surely, conflict with  microformat semantic
> markup. Having read the brainstorming hCard FAQ I initially used  <span
> style="display:none"></span> around the img tag - however I see no reason in
> this case to add the extra markup around the img tag. ( The is the future
> 'Proposed
> Additions'(http://microformats.org/wiki/hcard-parsing#Use_of_CSS_compute
> d_styles_instead_of_HTML_default_styles) but this is for text formating, as
> far as I can see, so it wouldn't interfere with an img file getting parsed
> correctly.)
>
> Using the Tails (0.3.6) Firefox add-on correctly parses the microformat
> content on this page including the image.
>
> Can anyone explain why the inline css style (display:none) cannot co-exist
> (ignoring the benefits of using external style sheets rather than inline
> css) with the microformat semantic markup. I'm probably missing something
> obvious here, so thanks for any advice.
>
> Cheers
>
> Euan

Hi Euan,

I've looked at this twice now and I can't see an obvious reason for
the hCard to be incorrect.  There is on-going debate on whether hiding
information is a good or bad idea, but the actual mark-up you've used
is correct and I've no trouble at all parsing your card in Tails,
Operator, etc.

If you look at hcard-issues [1] you'll find discussions on negative
impacts of hiding entire cards, but not specifically hiding a single
part of it.  Afterall, if the photo of your card was skipped, it would
still be a valid hCard without it.

You should carefully consider whether you want to hide the photo of
your card, and whether you want to do this inline especially.

Anyone else like to chime in?  I'm not totally sure here.

[1] http://microformats.org/wiki/hcard-issues

-- 
Frances Berriman
http://fberriman.com


More information about the microformats-discuss mailing list