![]() |
#1 |
Member
![]() Posts: 18
Karma: 10
Join Date: Oct 2013
Location: Melbourne, Australia
Device: kindle paperwhite v2
|
Section divider problem.
After deciding I'd use something different from the standard three asterixes for section breaks, I took the advice on the Sigil Tutorial and tried this:
<hr width="10%" color="#000000"> My first attempt gave me an immediate error, which I allowed Sigil to auto-correct into: <hr color="#000000" width="10%" /> I now have nice solid black lines centered where I want them, but today a test-run of Flightcrew returned the following errors: 'attribute 'color' is not declared for element 'hr', and 'attribute 'width' is not declared for element 'hr' Apparently I have to replace one or both of these attributes via CSS using 'color' and 'background-color' properties, but how exactly? Thanks. |
![]() |
![]() |
![]() |
#2 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Code:
<hr class="sectionbreak"/> Code:
hr.sectionbreak { color: #000000; width: 10%; margin: 1em 45%; } |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,641
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
<hr> as section separator? Dividers and fleurons Regards Rubén |
|
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 18
Karma: 10
Join Date: Oct 2013
Location: Melbourne, Australia
Device: kindle paperwhite v2
|
Jellby: tried your suggestion:
hr.sectionbreak { color: #000000; width: 10%; margin: 1em 45%; } I have a centered line, but it's that 3D-looking grey line, not solid black, so the hex value is not being respected(?) |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Add 'border: 0;' to the CSS and perhaps 'background-color: #000000;'.
Be aware that the lines will not show on readers that allow a 'night vision'. In those modes the colors of the text is rendered white and the background black, as long as there is no color set. So, in this case it would remain black. If you only want black lines, ditch the colors. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Different renderers apparently draw the rules differently. Some may use foreground color, some background color, some have a default border (to make them look 3D), etc. This makes it a little bit harder to override all the defaults. Try Toxaris's suggestions.
|
![]() |
![]() |
![]() |
#7 | |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,202
Karma: 34984330
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
Jellby said:
Quote:
I usually use something like: hr.sectionbrk { width: 20%; margin: 1em 40%; border: solid 2px; } |
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
That could work fine in most readers, including in night mode. Although I would probably use 'border: 0px;' and 'height: 2px;' in this case.
|
![]() |
![]() |
![]() |
#9 |
Member
![]() Posts: 18
Karma: 10
Join Date: Oct 2013
Location: Melbourne, Australia
Device: kindle paperwhite v2
|
Thank you, guys: thumbsup:. After a bit of playing around I settled on this to display the black line I was after:
hr.sectionbreak { color: #000000; width: 10%; border: solid 1px; margin: 1em 45%; } 'border 0' made the existing line vanish - or become white(?), and 2px was too thick, but 1px looks fine; 'backgroundcolor' doesn't seem to do anything. |
![]() |
![]() |
![]() |
#10 |
Member
![]() Posts: 18
Karma: 10
Join Date: Oct 2013
Location: Melbourne, Australia
Device: kindle paperwhite v2
|
Actually, I was premature. I suspected a different environment might make a difference regarding how 'color' and 'background-color' express themselves. With 'background-color' in my css, the line generated looks grey/3D in a PC viewer, but when transferred to my Kindle it appears solid black as originally desired. There you go!
|
![]() |
![]() |
![]() |
#11 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
The HR is basically a rectangle with a border. Default colours, as well as thickness of the rectangle and border settings my vary between renderers. You could try this (untested):
Code:
hr.sectionbreak { width: 10%; margin: 1em 45%; height: 0; /* invisible rectangle */ border-width: 0 0 1px 0; /* only bottom border */ border-style: solid; /* choose other styles if you want other than a continuous line */ } |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bookshelf Divider Tabs | MSWallack | Apple Devices | 7 | 04-20-2012 06:44 PM |
Metadata comment section problem | clady | Calibre | 3 | 09-24-2011 08:13 PM |
Problem of the section list with Chinese Fonts and Kindle 3 | Jmot | Recipes | 9 | 02-20-2011 10:57 PM |