473,405 Members | 2,261 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,405 software developers and data experts.

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 13544
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.