Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-12-2012, 10:37 PM   #1
StevenLin
Member
StevenLin began at the beginning.
 
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?
Attached Thumbnails
Click image for larger version

Name:	center.JPG
Views:	216
Size:	154.2 KB
ID:	83839  
StevenLin is offline   Reply With Quote
Old 03-12-2012, 11:46 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by StevenLin View Post
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?
I would use the margin-left: <value>
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)
theducks is offline   Reply With Quote
Old 03-13-2012, 01:18 AM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
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.
Toxaris is offline   Reply With Quote
Old 03-13-2012, 03:15 AM   #4
huebi
Zealot
huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!
 
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.
huebi is offline   Reply With Quote
Old 03-13-2012, 09:37 AM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by huebi View Post
May i ask what this have to do with Sigil? Thats HTML or ePub where we have a special forum for.
You are probably correct. If the question was 'How can I make Sigil do this (without resorting to CV ), it would be a Sigil question.
theducks is offline   Reply With Quote
Old 03-13-2012, 02:42 PM   #6
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by StevenLin View Post
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?
I guess your box should alway stay at the same size and should always be perfectly centered.

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 }
works quite well at most (but not all) devices.

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.
mmat1 is offline   Reply With Quote
Old 03-13-2012, 03:04 PM   #7
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
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)
Quote:
Originally Posted by theducks View Post
I would use the margin-left: <value>
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)
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%
Perkin is offline   Reply With Quote
Old 03-13-2012, 03:21 PM   #8
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by StevenLin View Post
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?
i think that this may be what you are looking for.

Code:
.centerbox{
width:50%;
padding:10px;
border:3px solid black;
margin-left:auto;
margin-right:auto;
margin-bottom:1em;
}
<div class="centerbox">. . . . </div>

You can adjust as needed.

Last edited by crutledge; 03-13-2012 at 03:30 PM. Reason: Sorry about the double post.
crutledge is offline   Reply With Quote
Old 03-13-2012, 03:50 PM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by crutledge View Post
i think that this may be what you are looking for.

Code:
.centerbox{
width:50%;
padding:10px;
border:3px solid black;
margin-left:auto;
margin-right:auto;
margin-bottom:1em;
}
<div class="centerbox">. . . . </div>

You can adjust as needed.
ADE does not do (it ignores) 'Auto'
Use the formula above
theducks is offline   Reply With Quote
Old 03-13-2012, 05:09 PM   #10
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
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.
HarryT is offline   Reply With Quote
Old 03-13-2012, 05:39 PM   #11
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by HarryT View Post
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.
You're right, but luckily i got a helmet ;-)

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.
mmat1 is offline   Reply With Quote
Old 03-13-2012, 09:57 PM   #12
StevenLin
Member
StevenLin began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jan 2011
Device: none
Quote:
Originally Posted by mmat1 View Post
You're right, but luckily i got a helmet ;-)

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.

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!
StevenLin is offline   Reply With Quote
Old 08-14-2012, 04:47 PM   #13
msmith65
Enthusiast
msmith65 began at the beginning.
 
msmith65's Avatar
 
Posts: 31
Karma: 10
Join Date: Aug 2012
Device: Kindle
This was a huge help to me today. Karma all around; thank you.
msmith65 is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 12:29 AM.


MobileRead.com is a privately owned, operated and funded community.