|
|
#1 |
|
eBook FANatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,861
Karma: 13081948
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Center object vertically on page
I wish to center an object vertically on it's own page. Is there a simple way of doing this? ![]() Perhaps someone could point me to a css statement!
__________________
Charlie 'Bene legere saecla vincere'. 'To read well is to master the ages' [Prof. Issac Flagg] |
|
|
|
|
|
#2 | |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,713
Karma: 2485850
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
Quote:
When it comes to Images, the problem is screens come in 3 sizes: to short, too long, just right . If you have a 800x600 screen and a 800x600 image (which is slight too big), then you try and display on a smaller screen? Have not tried:set the (Image) height: 80%; margin-top: 5%; margin-bottom: 5%
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54,661
Karma: 26165759
Join Date: Nov 2006
Location: UK
Device: Kindle Touch, PW, Fire HD, iPad 3, iPhone 4, Samsung Tab 2 7 + More
|
It won't work. There no way (that I know of) to vertically centre something on a page.
__________________
Harry Currently proofreading The Poison Belt, by Sir Arthur Conan Doyle. |
|
|
|
|
|
#4 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,142
Karma: 2505637
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
|
Only if you get "height: 100%" to be interpreted as the full screen height (minus margins). This is not clearly possible according to the spec (it's ambiguous at least), but some implementations might do that in some cases. Then, you can have a container with "height: 100%" (<body>, <div> or <svg>) and the image centered there, but it won't work everywhere.
|
|
|
|
|
|
#5 | |
|
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54,661
Karma: 26165759
Join Date: Nov 2006
Location: UK
Device: Kindle Touch, PW, Fire HD, iPad 3, iPhone 4, Samsung Tab 2 7 + More
|
Quote:
__________________
Harry Currently proofreading The Poison Belt, by Sir Arthur Conan Doyle. |
|
|
|
|
|
|
#6 | |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,142
Karma: 2505637
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
|
Quote:
|
|
|
|
|
|
|
#7 | |
|
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54,661
Karma: 26165759
Join Date: Nov 2006
Location: UK
Device: Kindle Touch, PW, Fire HD, iPad 3, iPhone 4, Samsung Tab 2 7 + More
|
Quote:
__________________
Harry Currently proofreading The Poison Belt, by Sir Arthur Conan Doyle. |
|
|
|
|
|
|
#8 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 555
Karma: 422221
Join Date: Jul 2010
Location: UK
Device: Sony PRS-300 & Kindle PW
|
|
|
|
|
|
|
#9 | |
|
eBook FANatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,861
Karma: 13081948
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Quote:
__________________
Charlie 'Bene legere saecla vincere'. 'To read well is to master the ages' [Prof. Issac Flagg] |
|
|
|
|
|
|
#10 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,142
Karma: 2505637
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
|
It still relies on setting a height for the container: "min-height: 10em;" or whatever.
|
|
|
|
|
|
#11 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 555
Karma: 422221
Join Date: Jul 2010
Location: UK
Device: Sony PRS-300 & Kindle PW
|
I wonder what it would do with min-height:100% or to a value greater than the physical reader page?
The "separate example" linked to from the page has code of: div.container {top: 0; left: 0; width: 100%; height: 100%; position: absolute; display: table} p {display: table-cell; vertical-align: middle} but I don't if all this is supported by eReaders. Last edited by Agama; 12-28-2012 at 02:22 PM. |
|
|
|
|
|
#12 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,142
Karma: 2505637
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
|
As discussed above and elsewhere, "height: 100%" is often ambiguous.
|
|
|
|
|
|
#13 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 555
Karma: 422221
Join Date: Jul 2010
Location: UK
Device: Sony PRS-300 & Kindle PW
|
Yep! You're right. I've tried many combinations and tested with ADE, calibre reader and Firefox and the results are inconsistent. This deceptively simple requirement appears to be quite intractable. Perhaps a future CSS standard will implement it.
|
|
|
|
|
|
#14 |
|
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54,661
Karma: 26165759
Join Date: Nov 2006
Location: UK
Device: Kindle Touch, PW, Fire HD, iPad 3, iPhone 4, Samsung Tab 2 7 + More
|
Exactly. It's a simple requirement, but there's no easy solution. Best thing to do at the moment is to simply leave a reasonable top margin, then insert whatever it is you want on the page (it's generally some sort of title page that you want this for).
__________________
Harry Currently proofreading The Poison Belt, by Sir Arthur Conan Doyle. |
|
|
|
|
|
#15 |
|
eBook FANatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,861
Karma: 13081948
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Doesn't seem o do much for ePub.
__________________
Charlie 'Bene legere saecla vincere'. 'To read well is to master the ages' [Prof. Issac Flagg] |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do you center text vertically? | 44reader | ePub | 8 | 08-06-2012 01:52 PM |
| Authors vertically | jfbok | Library Management | 4 | 05-30-2012 12:31 PM |
| Can you center vertically? | bfollowell | ePub | 10 | 07-07-2011 03:19 AM |
| How to center/fit page width SVG images with <OBJECT> | amoroso | ePub | 0 | 07-31-2010 11:48 AM |
| How to center an image vertically | GBAV | ePub | 23 | 06-16-2010 10:41 AM |