20060816

using style sheets in an eBay auction

[update: i'll leave this post up, but experimenting indicates that linking to an external style sheet in eBay auctions ends up with too many browser configurations entirely unable to see the auction description. i recommend against it.]

as huge as eBay is, i'm surprised at the scant information via google on using style sheets (CSS) in auctions. if you googled your way here, understand that i'm not a web weenie; i only know that the method i've arrived at through experimenting appears to work pretty well. it may be a bunch of unnecessary crap, but i suspect not.

i guess some purists would insist that you shouldn't use style sheets for eBay auctions, because the style sheets must be linked, imported, or whatever between style tags in the head — the same head of which there must only be one per web page. well, to hell with that. i've had good luck linking style sheets without style tags, and without a second head section. works in both firefox and IE, and apparently in netscape too (from a report a helpful tester gave of my first auction using my style sheet).

when i first started, i was thrilled with my apparent success in previews. however, as soon as i uploaded the auction and eBay posted it, i realized i'd fucked away the entire page with my style sheet — a definite bugger, because eBay can zap your auction for that if they see it.

the key is to play off of eBay's helpful wrapping of the auction description in div tags with an ID of "EBdescription". soon as i changed my style sheet to only affect an EBdescription ID, it went seamless and no longer screwed the entire page. you'll need to wrap your html in a temp EBdescription div for your style sheet to apply in previews, but that's no big deal, long as you remember to remove it when posting.

eBay extends the EBdescription section to include additions to the auction description (after bidding has begun) instead of revisions. so you can use the same style sheet for additions.

i start the description with:
<LINK href="http://yourdomain.whatever/style.css" type=text/css rel=STYLESHEET>
when previewing, which i normally do locally instead of via eBay's auction preview, i wrap the html in:
<html><div id="EBdescription">

</div></html>
as explained, that wraparound bit should be removed before posting at eBay.

Labels:

At 17 August, 2006 06:54, Blogger saltypig said...

irrelevant comment moved to new post.

 
At 01 September, 2006 19:26, Anonymous Scott said...

Ok, so I'm trying to use the code you've set up and I'm having an issue with it. I am receving the following error: XML Parse error. XML Error Text: "; nested exception is: org.xml.sax.SAXParseException: The element type "LINK" must be terminated by the matching end-tag "".".

My code looks like this: < Description >< LINK href="http://loudrhino.com/css/listing.css" type="text/css" rel="STYLESHEET" >DESCRIPTION GOES HERE< /Description >

BTW, I know there are extra spaces around the Description and Link tags. I had to put those there for submission purposes.

I am unsure what I'm doing wrong. Any help you can provide would be greatly appreciated.

Thank you, Scott.

 
At 01 September, 2006 20:24, Anonymous Scott said...

I've got this working finally. In order to do this I had to put a < ![CDATA[ LINK and DESCRIPTION GO HERE ] ]>

 
At 01 September, 2006 22:01, Blogger saltypig said...

wow. never saw anything like that when using the link tag. thanks for posting your solution for others that wander by. glad you got it working.

 
At 24 November, 2006 15:37, Anonymous Matt said...

Thanks for this! Just what I needed.

Just to be clear for those that aren't overly familiar with CSS your styles should look like this to only apply to the EBdescription DIV

#EBdescription h1 {...}
#EBdescription .class {...}

 
At 25 November, 2006 17:56, Blogger saltypig said...

thank you, matt. glad you found this post and it works.

 

<< Home