![]() |
#1 |
Member
![]() Posts: 19
Karma: 10
Join Date: Apr 2015
Device: Kindle, Nook, Android
|
Newbie with CSS question
Hi, brand new to Sigil and formatting, but I have some basic css understanding.
My stylesheet is working for several of my headers, which I have modified and have taken just fine. But when I try to define a first paragraph no indent style (changing the <p> to a <p.first> which I have added to the css, it works fine when I look at it after jumping out of code view. However, when I try to save it, it reverts back to <p>. I imagine there is a piece of code I am missing, or that is inserted somewhere keeping this change from taking place? Anyone have any ideas. |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,361
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
If you have a p.first { } entry in your css, you apply it to an element by adding the "class" attribute to that element with a value of "first". Specifically; <p class="first"> |
|
![]() |
![]() |
![]() |
#3 |
Member
![]() Posts: 19
Karma: 10
Join Date: Apr 2015
Device: Kindle, Nook, Android
|
Of course I was actually putting it in!
![]() I guess I should amend my first statement about having some basic css understanding... And yes, your code worked like a charm. Thanks! Actually I had seen that on the Sigil manual, and tried it, but I had set my indent to .001 which doesn't seem to work, so it didn't appear to have worked? Somewhere I read that some ereaders will auto indent 0 defined paragraphs, and it was suggested to have a minute indent like .001? But, as mentioned, I have only been at this conversion stuff since yesterday! Thanks again for your help. ... whoops, almost signed off before also asking ... What's the best way to amend all my other 34 first chapter paragraphs? Is there any type of s&r trick, or paste them in one by one? |
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,683
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
However, it'd be probably more efficient to use a CSS plus operator in your stylesheet. Assuming that all your chapter headings are enclosed in h3 tags, you could for example use the following styles to indent all paragraphs except for the first paragraph immediately following a h3 heading. Code:
p { text-indent: 1em; margin: 0;} h3 + p { text-indent: 0; } Last edited by Doitsu; 04-07-2015 at 05:23 PM. |
|
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 19
Karma: 10
Join Date: Apr 2015
Device: Kindle, Nook, Android
|
Doitsu! Thanks, that was a breeze and a big help. I appreciate the replies, and have learned a lot just from seeing how they work. I can see how important the css (and learning it!) is going to be in this project.
|
![]() |
![]() |
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
Or you could use
p {text-indent:0;} p + p {text-indent:1em;} That allows for breaks that are delimited other than by h3. |
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Apr 2015
Device: none
|
Newbie to epub and Sigil
I'm trying to copy and paste a css file into Sigil, but it won't take it. It doesn't even show up on the clipboard history. This is my first experience with the epub world and specifically to Sigil. What am I missing?
|
![]() |
![]() |
![]() |
#8 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Apr 2015
Device: none
|
Saoved the file as .css instead of .txt and added it to Sigil. It worked.
|
![]() |
![]() |
![]() |
#9 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
Or you can create a blank stylesheet in Sigil and paste the contents in.
|
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 972
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-T2, Kindle Paperwhite 11th gen
|
|
![]() |
![]() |
![]() |
#11 |
Member
![]() Posts: 19
Karma: 10
Join Date: Apr 2015
Device: Kindle, Nook, Android
|
So, if I'm following this, p would be defined as no indent for the default, and p + p would give that particular paragraph an indent? (Though for now, my simple project only needs the no indent after the chapter subheading once for each new chapter)
|
![]() |
![]() |
![]() |
#12 |
Member
![]() Posts: 19
Karma: 10
Join Date: Apr 2015
Device: Kindle, Nook, Android
|
Pablo, thanks for posting that link. Your guide is a great help since I only opened Sigil for the first time yesterday. I love how you have both the pdf and epub versions to compare back and forth. I opened your epub in Sigil and can toggle between code and page, which makes learning and understanding so much easier. Nice!
|
![]() |
![]() |
![]() |
#13 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
So, in that case only the first paragraph would have no indent. |
|
![]() |
![]() |
![]() |
#14 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 972
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-T2, Kindle Paperwhite 11th gen
|
Quote:
|
|
![]() |
![]() |
![]() |
#15 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
Quote:
Yup. Same idea as the other suggestion, but approached from a different angle. You can set indent as the default, but make an exception when <p> is preceded by <h3>. Or you can default to no indent, but make an exception when <p> is preceded by another <p> (i.e. for all paragraphs except the first). |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
css question | ralphiedee | Sigil | 74 | 12-23-2012 06:29 AM |
CSS Question | jackibar | Sigil | 24 | 03-01-2012 09:12 AM |
CSS question | crutledge | Workshop | 17 | 12-17-2011 07:52 AM |
CSS Question | AppleTard | Calibre | 1 | 06-12-2011 12:07 AM |
Help! Newbie having problems converting HTML/CSS files | jackie_w | Calibre | 6 | 09-14-2009 04:53 PM |