Click to See Complete Forum and Search --> : [RESOLVED] alternative to <sup>?


KristenPie
04-16-2008, 02:40 PM
Hi there. I have an unordered list in which there are some dates. I want to put the "st" and "th" in superscript, but XHTML transitional doesn't allow the <sup> tag.

<ul>June 29<sup>th</sup> through September 1<sup>st</sup> 2008
<li class="indent">One month rental&nbsp;&nbsp;&nbsp;&nbsp;$12,300.00</li>
<li class="indent">Two week rental&nbsp;&nbsp;&nbsp;&nbsp;$6,500.00</li>
</ul>

So I switched to <span> tags and added some CSS, but XHTML transitional doesn't allow them in lists.

<ul>June 29<span class="sup">th</span> through September 1<span class="sup">st</span> 2008
<li class="indent">One month rental&nbsp;&nbsp;&nbsp;&nbsp;$12,300.00</li>
<li class="indent">Two week rental&nbsp;&nbsp;&nbsp;&nbsp;$6,500.00</li>
</ul>


Do any of you know other alternatives?

dtm32236
04-16-2008, 03:25 PM
[edit] i posted an answer, but the realized that it wouldn't work.

dtm32236
04-16-2008, 03:28 PM
my only solution - ditch the XHTML and switch over to HTML (as I can pretty much guarantee that your site doesn't use anything that requires a XHTML doctype)

KristenPie
04-16-2008, 04:18 PM
Yeah, I don't need to be using XHTML, but it's nice for easier updating in the future.

Tabo
04-16-2008, 04:57 PM
<span style="vertical-align: sup;">Super?</span>
<span style="vertical-align: super;">Super?</span>

I think either or should work, depending on the age (and make?) of the browser. you could also make the font size .5em, and give padding-bottom (or margin bottom) of the super text, however there may be problems as I guess you are using an inline level element..

felgall
04-16-2008, 04:59 PM
The only problem with the original code posted is that you have content inside the <ul> tag that isn't inside an <li> tag and therefore the whole content is invalidly placed and not just the <sup> tag. Put the missing tags in and both the content and the sup tag will then be valid.

dtm32236
04-16-2008, 06:19 PM
oh - true. I didn't even notice that.

KristenPie
04-17-2008, 12:15 AM
Oh, of course! Sometimes, you get so focused on one aspect that you don't realize it's a larger problem. <sup> isn't on my list of deprecated elements because it's still valid. I moved all the content into <li> tags and it validates perfectly. Thanks, Stephen, and everyone else who commented.