473,385 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Trying to show dollar value but superscript isn't enough

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
2 3594
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: MBS | last post by:
I am trying to pass a string from one page to another. The input string comes from a database and many times has the superscript TM trademark symbol. The querystring handles this properly because...
8
by: dalei | last post by:
The following code does not work. Can anyone help with modifying it? <script type='text/javascript'> function super2 () { var theNum = prompt ('Please enter a number: ', ' ');...
2
by: JK | last post by:
Hi All, I am working a form which is tabular layout (continuous form) which will display multiple records at a time. Each line of record needs to be reflected on the color code to show their...
6
by: Sridhar | last post by:
Hi, I need to display a calendar that shows all the months of an year. In that, I need to show different colors for certain events. I know how to display a calendar for a certain month but I am...
3
by: mark.a.lemoine | last post by:
I need to be selecting records based on the value of a string-format currency value. Specifically, I have a table with a field of type varchar(50). Stored in this field is a dollar-formatted...
1
by: Satyabrata | last post by:
Can anybody provide me some pointers on how to modify a JSP / CSS / table.htc to make the subscript / superscipt functionality available for a table header? Though the row values show the...
5
by: sdupont | last post by:
Hi all, I have a need to make a guest registry, and try as I might, I just can't seem to get the right programming in the expression builder. Here is what I need to do. I have one field...
8
by: Ben | last post by:
If you want to use both subscript and superscript *together*, how do you make them align horizontally? E.g., I want to have a^2_i (read in LaTeX), how do you make both '2' and 'i' align...
4
by: Barthy | last post by:
I have created the majority of the code needed fo it to run properly...it worksby displaying the amount of each coin used in the amount inserted by the user...but it wont subtract it from the initial...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.