03-12-2012, 10:37 PM | #1 |
Member
Posts: 10
Karma: 10
Join Date: Jan 2011
Device: none
|
How do I centralize the box?
I want to put the colored box in the center, but I've tried several css that don't seem to work. How do I put it in the central position instead of in the current left position?
|
03-12-2012, 11:46 PM | #2 | |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
to fake centering , care needs to be taken that the box will always fit the display width (ADE has issues with auto margins, so be forewarned) |
|
03-13-2012, 01:18 AM | #3 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You might try a table. It is not nice, but it will probably work.
|
03-13-2012, 03:15 AM | #4 |
Zealot
Posts: 121
Karma: 5070
Join Date: Dec 2010
Device: none
|
May i ask what this have to do with Sigil? Thats HTML or ePub where we have a special forum for.
|
03-13-2012, 09:37 AM | #5 |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
03-13-2012, 02:42 PM | #6 | |
Berti
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
Quote:
IMO it's not possible to find a solution with paragraph or table formatting which is perfect everywhere. Table-fomatting: Code:
table { margin: 1em auto } td { border: 1px solid black; text-align: center; width: 200px } With paragraph-formatting it will be a bit difficult to keep the box at the same size, if the screen size changes. So i got a third suggestion: make a image. |
|
03-13-2012, 03:04 PM | #7 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
If the box can be defined width as a % of display width, then the left margin coluld be 100%-BoxWidth% divided by 2, so if BoxWidth=70% then left margin would be 15%
|
03-13-2012, 03:21 PM | #8 | |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Quote:
Code:
.centerbox{ width:50%; padding:10px; border:3px solid black; margin-left:auto; margin-right:auto; margin-bottom:1em; } You can adjust as needed. Last edited by crutledge; 03-13-2012 at 03:30 PM. Reason: Sorry about the double post. |
|
03-13-2012, 03:50 PM | #9 | |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Use the formula above |
|
03-13-2012, 05:09 PM | #10 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
This will probably have the HTML purists beating their heads against the wall in horror, but the "depracated-but-still-supported-by-all-devices" <center> tag is jolly useful for this kind of thing.
|
03-13-2012, 05:39 PM | #11 | |
Berti
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
Quote:
Sigil transforms the "<center>" to an "sgc-1 {text-align: center}" without hesitation. "<center>" ist html-transitional only, so i won't assume, that it will be supportet by all devices. |
|
03-13-2012, 09:57 PM | #12 | |
Member
Posts: 10
Karma: 10
Join Date: Jan 2011
Device: none
|
Quote:
WOW!!! There are so many replies!!! A great thank to all of you. I will give it a try on the suggestions all of you have put here. Thanks to you all! |
|
08-14-2012, 04:47 PM | #13 |
Enthusiast
Posts: 31
Karma: 10
Join Date: Aug 2012
Device: Kindle
|
This was a huge help to me today. Karma all around; thank you.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Text in a box? | Skeezix | Kindle Formats | 3 | 01-23-2012 07:22 AM |
Thinking 'outside the box'...new uses... | Reader Paradice | Kobo Tablets | 20 | 12-01-2011 06:42 PM |
$119.99 PE New in Box | Emptora | enTourage eDGe | 4 | 08-17-2011 02:14 PM |
Sell Smart Q7, w/ box etc. | rogue_ronin | Flea Market | 0 | 12-17-2009 06:46 PM |
Kindle out of the box | aconfrere | Introduce Yourself | 3 | 01-18-2008 07:02 PM |