View Full Version : Invisible text


DaleDe
05-04-2009, 12:43 PM
I have an eBook that includes the physical page numbers from the paper book. I would like to leave these in the document for possible use in searching or referencing purposes but I don't want them to be displayed. Is there a way to do that? The book has a lot of cross references to physical pages.

Dale

netseeker
05-04-2009, 12:54 PM
You can use style="visibility:hidden;", eg.:

<span style="visibility:hidden;">1</span>

Jellby
05-04-2009, 01:31 PM
or "display: none"

tirsales
05-04-2009, 01:40 PM
Could you use a class?

e.g.
<span class="invisible">..</span> and in your CSS
.invisible {
display: none;
}

Hard-coding styles into HTML or XHTML or XML is really ugly.

netseeker
05-04-2009, 01:40 PM
or "display: none"
I already thought i missed one option. :)
Actually "display: none" seems to be the better choice, because it shouldn't occupy visible space - which does happen when using "visibility: hidden".

netseeker
05-04-2009, 01:48 PM
Could you use a class?
[..]
Hard-coding styles into HTML or XHTML or XML is really ugly.
Sure, but imho it's better comprehensible with a inline style within a simple example. :)

tirsales
05-04-2009, 01:50 PM
Sure, but imho it's better comprehensible with a inline style within a simple example. :)It is ;) But I still wanted to add this as (so far) I've nearly always found inline examples on this board, and just once I wanted to say "use classes" ;)

zelda_pinwheel
05-04-2009, 01:51 PM
It is ;) But I still wanted to add this as (so far) I've nearly always found inline examples on this board, and just once I wanted to say "use classes" ;)
they're classier. :D

DaleDe
05-04-2009, 01:52 PM
Thanks for the response. I will give it a try. I know how to translate inline examples to CSS sections and files.

Dale

nrapallo
05-04-2009, 02:44 PM
When I retrieve a Project Gutenberg ebook in HTML form, I usually leave the page number (href) references in, but remove the actual PG #'s using a RegEx, like the below example written in Perl:#Remove page numbering
$html =~ s#<span class='pagenum'><(.*[^>])>.*</span>#<$1>#gi ;
$html =~ s#<span class=\"pagenum\"><(.*[^>])>.*</span>#<$1>#gi ;

It just leaves the <a name/id> reference i.e. <$1>.

DaleDe
05-04-2009, 04:11 PM
When I retrieve a Project Gutenberg ebook in HTML form, I usually leave the page number (href) references in, but remove the actual PG #'s using a RegEx, like the below example written in Perl:#Remove page numbering
$html =~ s#<span class='pagenum'><(.*[^>])>.*</span>#<$1>#gi ;
$html =~ s#<span class=\"pagenum\"><(.*[^>])>.*</span>#<$1>#gi ;

It just leaves the <a name/id> reference i.e. <$1>.


Yea, but I have hundreds of such references and no html links. For now I want to be able to have the real page numbers. The display:none trick worked well in my sample. I have to check a few different readers. It is reasonable to have the published page numbers for reference purposes.

Dale

Jellby
05-05-2009, 04:55 AM
I already thought i missed one option. :)
Actually "display: none" seems to be the better choice, because it shouldn't occupy visible space - which does happen when using "visibility: hidden".

And that makes "visibility:hidden" what I was looking for for some other cases. Sometimes the detective finds a half-burnt note with some letters missing, and it's good to have something that hides the letters but preserves the space ;)