By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,765 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,765 IT Pros & Developers. It's quick & easy.

Trying to show dollar value but superscript isn't enough

P: n/a
Hi all, am trying to show a dollar figure on my webpage, but defining
this for the cents value:

font-size: 80%;
vertical-align: super;

just isn't cutting it!

Is there a way to reduce the spacing before the decimal value, so I
canbring it closer to the dollar value?

Or does anyone know a better way to "neatly" do this using CSS or HTML
tags?

Many thanks,

Sergio

Feb 27 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Scripsit SergioQ:
Hi all, am trying to show a dollar figure on my webpage, but defining
this for the cents value:

font-size: 80%;
vertical-align: super;

just isn't cutting it!
Exactly what are you trying to do? URL? You only posted two CSS
declarations, not even a rule. We need a URL of a complete example, with
HTML code and all.

Maybe you are looking for vertical-align: text-top.

Anyway, did you consider how the page works when your CSS rules are ignored?
If you don't have a decimal point, i.e. if you _rely_ on the special
rendering, then all your figures become 100 times bigger when CSS is turned
off...
Is there a way to reduce the spacing before the decimal value, so I
canbring it closer to the dollar value?
Well, using letter-spacing, but not very well due to browser differences.
Setting a negative margin works better. But why would you do that?

If I guess correctly, the following might resemble what you want:

<style type="text/css">
ul { margin: 0; padding: 0; }
..sep { display: none; }
..c { font-size: 80%;
vertical-align: text-top; }
</style>

....

$4<span class="sep">.</span><span class="c">99</span>

It's rather awkward markup, but what can you do?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Feb 27 '07 #2

P: n/a
On Tue, 27 Feb 2007, SergioQ wrote:
Hi all, am trying to show a dollar figure on my webpage, but defining
this for the cents value:

Or does anyone know a better way to "neatly" do this using CSS or HTML
tags?
$4.99
99

--
In memoriam Alan J. Flavell
http://groups.google.com/groups/sear...Alan.J.Flavell
Feb 28 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.