Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-16-2013, 03:27 AM   #1
pargoo
Member
pargoo began at the beginning.
 
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.
pargoo is offline   Reply With Quote
Old 12-16-2013, 07:17 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Code:
<hr class="sectionbreak"/>
and in the CSS code:

Code:
hr.sectionbreak {
  color: #000000;
  width: 10%;
  margin: 1em 45%;
}
(the "1em" part you can change it to whatever you want, the "45%" part ensures that the rule will be centered: 45+10+45=100)
Jellby is offline   Reply With Quote
Advert
Old 12-16-2013, 11:44 AM   #3
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,641
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by pargoo View Post
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.
Maybe you could find useful these threads:

<hr> as section separator?

Dividers and fleurons

Regards
Rubén
RbnJrg is offline   Reply With Quote
Old 12-17-2013, 01:54 AM   #4
pargoo
Member
pargoo began at the beginning.
 
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(?)
pargoo is offline   Reply With Quote
Old 12-17-2013, 02:24 AM   #5
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: 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.
Toxaris is offline   Reply With Quote
Advert
Old 12-17-2013, 03:16 AM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
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.
Jellby is offline   Reply With Quote
Old 12-17-2013, 03:30 AM   #7
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,202
Karma: 34984330
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
Jellby said:
Quote:
Some may use foreground color, some background color,
That's interesting, I thought they by default matched the font/foreground color, so I never set a color at all. Maybe some of my hr's are not showing up in night mode.

I usually use something like:

hr.sectionbrk {
width: 20%;
margin: 1em 40%;
border: solid 2px;
}
GrannyGrump is offline   Reply With Quote
Old 12-17-2013, 04:19 AM   #8
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: 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.
Toxaris is offline   Reply With Quote
Old 12-18-2013, 12:27 AM   #9
pargoo
Member
pargoo began at the beginning.
 
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.
pargoo is offline   Reply With Quote
Old 12-21-2013, 12:56 AM   #10
pargoo
Member
pargoo began at the beginning.
 
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!
pargoo is offline   Reply With Quote
Old 12-21-2013, 03:28 AM   #11
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
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 */
}
I believe by default the border will be rendered in the text colour (black normally, white in "night mode", etc.), so it's better not to touch it, but if you want to specify the rule colour, use border-color.
Jellby is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 05:53 PM.


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