Forum Moderators: open

Message Too Old, No Replies

hCard microformat property needs to be styled to span multiple lines

And to keep the format valid. For a long "street-address"

         

penders

12:16 pm on Mar 16, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm using the hCard microformat to markup an address on an HTML page. But the "street-address" is very long and needs to be split across 2 lines when viewed. What markup can I use within this property in order to achieve this - maintaining a valid microformat?

eg.
<span class="street-address">Unit 123 The Blue Widget Trading Estate, Some Street Name</span>


I need to display it like this (split on the comma):
Unit 123 The Blue Widget Trading Estate 
Some Street Name


Presentational BR's not allowed I assume. Perhaps a SPAN? Or a bit of JavaScript?!

Any thoughts? Thanks.

pageoneresults

12:41 pm on Mar 16, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Have you looked at the
extended-address
property?

<div class="adr">
<span class="extended-address">Unit 123 The Blue Widget Trading Estate</span><br />
<span class="address">Some Street Name</span>
</div>

penders

2:09 pm on Mar 16, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I had seen the extended-address property, but was not aware that it would apply here - I've only seen a couple of examples of its use.

I assume you mean "street-address" as opposed to "address"? (I don't see "address" in the spec?)

I had initially thought that the whole text above would apply to the street-address property, although on reflection may be it doesn't. If the address was simply '123 Some Street Name' then I assume it would.

Thanks.

pageoneresults

2:34 pm on Mar 16, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<div class="adr">
<span class="extended-address">Unit 123 The Blue Widget Trading Estate</span><br />
<span class="street-address">Some Street Name</span>
</div>


Yes, it should be
street-address
, my oversight. Example above corrected, thank you.

hCard 1.0 Property List
[Microformats.org...]

I had initially thought that the whole text above would apply to the street-address property, although on reflection may be it doesn't. If the address was simply '123 Some Street Name' then I assume it would.


You've got a Unit Number there which leads me to believe it qualifies for an
extended-address
property. If not, I believe you can use multiple
street-address
properties e.g.

<div class="adr">
<span class="street-address">Unit 123 The Blue Widget Trading Estate</span><br />
<span class="street-address">Some Street Name</span>
</div>


If you're wondering about the use of multiple
street-address
properties, it is allowed...

hCard CheatSheet
[Microformats.org...]

*OPTIONAL, and MAY occur more than once