![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Setting first line of a blockquote or div
I often set the first paragraph of a blockquote to the left - (text-indent: 0)
Is the CSS which I can apply to the blockquote so that the first paragraph in it is not indented? It's easy to ensure that the first paragraph after a blockquote is not indented, but I'm talking about the first paragraph within the blockquote. |
![]() |
![]() |
![]() |
#2 | |
Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Quote:
You mean like this? Code:
// Make first paragraph directly enclosed by blockquote be flush left. blockquote > p { text-indent: 0; } // Make subsequent paragraphs directly enclosed by blockquote be // indented as usual. blockquote > p + p { text-indent: 2em; // or whatever } The + selector is the next sibling selector, matching the p tag when it is immediately after another p tag. Or use the ~ selector if your reading system supports it, but that isn't guaranteed in EPUB-2-based readers. If you know that the paragraph tag will be the first child of its parent, you could also do: Code:
// Make most paragraphs directly enclosed by blockquote be // indented as usual. blockquote > p { text-indent: 2em; // or whatever } // Make first paragraph directly enclosed by blockquote be flush left. blockquote > p:first-child { text-indent: 0; } Last edited by dgatwood; 06-17-2016 at 03:46 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Thanks, that's most helpful.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
setting line-height between paragraphs of poetry in epubs | Derek R | ePub | 12 | 03-14-2013 04:38 AM |
calibredb command line question (setting metadata) | mezme | Calibre | 0 | 12-06-2011 12:17 AM |
Feature Request: configurable space setting for "Insert blank line" in "Look & Feel" | therealjoeblow | Calibre | 15 | 07-25-2011 03:14 PM |
Thinking of setting up on line ereader shop and want some advice! | Xiaopanda | Which one should I buy? | 6 | 05-26-2009 07:48 PM |
Line indents using "<div>" tags | HarryT | Kindle Formats | 11 | 04-29-2009 10:18 PM |