Register Guidelines E-Books Search Today's Posts Mark Forums Read

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:	94
Size:	154.2 KB
ID:	83839  
StevenLin is offline   Reply With Quote
Old 03-12-2012, 11:46 PM   #2
theducks
Grand Sorcerer
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: 14,478
Karma: 5567061
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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: 2,905
Karma: 2909045
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
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
Grand Sorcerer
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: 14,478
Karma: 5567061
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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
Det
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: 949
Karma: 1119522
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: 644
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
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: 15,095
Karma: 13495654
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 online now   Reply With Quote
Old 03-13-2012, 03:50 PM   #9
theducks
Grand Sorcerer
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: 14,478
Karma: 5567061
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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: 63,180
Karma: 41305389
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
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
Det
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: 949
Karma: 1119522
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:42 PM.


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