473,461 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Superscript that doesn't distort line spacing

In order to do superscripts, for footnotes, I used the following
class:

..fnote {vertical-align: super; font-size: smaller;}

(It's always in an anchor, e.g. <a class="fnote" etc.>1</a>

...for footnote 1.)

But that creates an extra space between the line and the one above it,
which looks bad. Is there a solution?
Jul 20 '05 #1
5 13546
bs*****@mac.com (Ben Sharvy) wrote:
In order to do superscripts, for footnotes, I used the following
class:
.fnote {vertical-align: super; font-size: smaller;}
But that creates an extra space between the line and the one above it,
which looks bad.


I quote from the stylesheet
http://ppewww.ph.gla.ac.uk/~flavell/style.css

| /* put some air into the line-height, then scale-down the line-height
| used for sub/sup. Supposed to reduce the higgledy-piggeldy effect.
| (Suggested by Matt McIrvin - thanks! */
| p { line-height: 115%; }
| sub, sup { line-height: 0.1em; }

BTW: Do not use "font-size: smaller". Rather write "75%" or similar.
Jul 20 '05 #2
> BTW: Do not use "font-size: smaller". Rather write "75%" or similar.

Why not?
--
http://www.snook.ca/
Jul 20 '05 #3
bs*****@mac.com (Ben Sharvy) wrote:
In order to do superscripts, for footnotes, I used the following
class:

.fnote {vertical-align: super; font-size: smaller;}
The use of the keyword smaller has rather unpredictable effects in
practice.

But most importantly, superscript footnotes work poorly on the Web.
In particular, if they are links - as they naturally should be, this is
hypertext after all - it is difficult to click on them. For a
discussion of footnotes (or, rather, endnotes) on Web pages, check
http://www.cs.tut.fi/~jkorpela/www/fn.html
But that creates an extra space between the line and the one above
it, which looks bad. Is there a solution?


Well, just partial solutions. See
http://www.cs.tut.fi/~jkorpela/math/#subsup

But in this case, I would suggest that you avoid creating the problem
in the first place, and use footnote references that are normal-size
(or a little smaller) text in non-superscript position.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #4
In article <d1**************************@posting.google.com >,
bs*****@mac.com (Ben Sharvy) wrote:
In order to do superscripts, for footnotes, I used the following
class:

.fnote {vertical-align: super; font-size: smaller;}
That makes it very small. Can't you skip the font-size property here?

(It's always in an anchor, e.g. <a class="fnote" etc.>1</a>

..for footnote 1.)

But that creates an extra space between the line and the one above it,
which looks bad. Is there a solution?


Adjust line-height for it.

--
Kris
kr*******@xs4all.netherlands (nl)
Jul 20 '05 #5
Here's a way to avoid the dependency on increased line-height (i.e., line spacing):

Expand|Select|Wrap|Line Numbers
  1. .footnote {
  2.     position:relative;
  3.     font-size:85%;
  4.     top:-0.9ex;
  5.     margin-left:0.2em;
  6.     margin-right:0.1em;
  7. }
  8.  
In the HTML, it looks like this:

[HTML]
...some text<span class="footnote" id="fnrt15">15</span></a> continuing after a superscripted footnote reference.
[/HTML]

You can see an example of this on our Web site, e.g. the article http://konsequenz.code-flow.net/html...ending-en.html
where we've also added popup footnotes/endnotes functionality (the text being taken directly from the referenced <div> at the end of the article).

A similar solution was proposed in another thread:
http://www.thescripts.com/forum/thread96021.html

Note that we prefer using "ex" rather than "em" as vertical offset unit, since it is the typographic unit referring to the height of an "x" glyph ("em" referring to the width of an "m" glyph, i.e., being more appropriate for a horizontal offset). We also finetune the spacing before and after the footnote reference using "margin-left" and "margin-right" (note the offset unit here is "em").

code flow
http://www.code-flow.net
Jun 26 '06 #6

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...
2
by: Steven | last post by:
Hi, I have a function which reads all lines from an array and writes them with the required tags. This works fine with IE, but not with Mozilla. On...
8
by: Paul Wake | last post by:
I have some endnotes in http://www.xmission.com/~wake/utahjuvenilelaw.html and to do so included the endnote numbers as superscript in the text of the article. The lines with endnote numbers are...
2
by: puzzled | last post by:
I am trying to use css to control the indentation within items in a list. I would like something that looks like this: Text of a paragraph goes here, leading to the following list: * list...
9
by: PinkBishop | last post by:
I have included my .css script below. This is my first attempt at CSS. The pages look fine through they eyes of PC browsers and NS on the Mac. On IE and Safari for Mac all hell breaks...
7
by: Danny | last post by:
I have a small <div> element which contains two text blocks - one within <h5> tags and the other within <p> tags. I don't want any extra line spacing between elements so use the display:inline...
4
by: metoikos | last post by:
I've scoured the web (clumsily, I'm sure) for information on the difficulties I am having, checked my markup in validators, and had a friend with more CSS clue look over it, but I haven't had any...
2
by: SergioQ | last post by:
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...
4
by: interr0bangr | last post by:
Hey all, Does anyone have any tips when coding superscript for email newsletters? My client uses insane amounts of superscripted characters (usually to reference the legal fine print) and I've...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.