|
|
#1 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 679
Karma: 1085478
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-600, Acer 1825PT, Galaxy Tab, PRS-T1, HTC One X, TF700T
|
Centering blockquotes
I'm trying to get some text that is centred in the horizontal alignment but still have the text aligned to the left or the right. This would be most useful for me when I've got a quote and also who quoted it with the author of the quote to the right. Example Code:
p.right {text-align: right;}
blockquote {width: 60%;}
<blockquote>"This is a test quote, not actually written by anyone. So I'd thought I'd use it for this example"
<p class="right">-the author.</p>
</blockquote>
How do I move the blockquote so it is centred?
__________________
Get 5GB of online storage for free from SugarSync. Click here for an additional 500MB to give you 5.5GB for free. Always have your stuff when you need it with @Dropbox. 2GB account is free! Click here Currently working on updating some of my Lovecraft work after receiving some corrections |
|
|
|
|
|
#2 |
|
Reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 500
Karma: 8718
Join Date: Aug 2009
Location: Cochabamba, BO
Device: Onyx Boox 60, iPod Touch
|
This would center the whole blockquote with respect to its environment:
Code:
blockquote {margin: 0 auto; width: 60%;}
Code:
text-align: center |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,133
Karma: 2460081
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
|
Why not this?
Code:
blockquote: { margin: 0 20%; }
|
|
|
|
|
|
#4 |
|
Reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 500
Karma: 8718
Join Date: Aug 2009
Location: Cochabamba, BO
Device: Onyx Boox 60, iPod Touch
|
Of course it will do the same. But the other one is usually more logical with respect to style. For example when you are interested in specifying the width of the box in the first place and not so much in the exact size of the margins. Also when you want to give the size of the boxquote in absolute amounts (pixels, cm, inches) you have to use that form. So I would in general call the last for a premature optimization.
|
|
|
|
|
|
#5 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 679
Karma: 1085478
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-600, Acer 1825PT, Galaxy Tab, PRS-T1, HTC One X, TF700T
|
Thanks guys, these tips have helped solve my problem.
__________________
Get 5GB of online storage for free from SugarSync. Click here for an additional 500MB to give you 5.5GB for free. Always have your stuff when you need it with @Dropbox. 2GB account is free! Click here Currently working on updating some of my Lovecraft work after receiving some corrections |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Centering PDF | nguirado | Amazon Kindle | 5 | 10-04-2010 08:45 PM |
| How to do centering | sjohnson717 | Calibre | 15 | 02-28-2010 09:20 AM |
| ebook publisher & blockquotes | Chauncey | IMP | 5 | 02-10-2010 10:43 AM |
| centering images with css override? | Amalthia | Calibre | 2 | 03-30-2009 01:53 PM |
| Bookdesigner - Centering Title Author... | davers | Workshop | 7 | 01-12-2009 04:21 PM |