Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-22-2013, 10:36 AM   #1
zacsmith
Junior Member
zacsmith began at the beginning.
 
zacsmith's Avatar
 
Posts: 8
Karma: 10
Join Date: Oct 2012
Device: Kindle, iPhone 3GS
What am I missing in using <span> for bold?

Using Sigil 0.6.1 for Mac. I've looked for this issue issue here and elsewhere, but can't find a clue...

I seem to be missing something in using <span> to make words bold.

Here's the CSS:

Quote:
.b {
font-weight:bold !important;
}
And the HTML:

Quote:
<p><span class="b">Awareness</span>&nbsp;—&nbsp;The ability to look beyond your ego and see yourself as both a physical and spiritual being.</p>
The <span> for the bold word "Awareness" does not work (the word is not bold).

Using this HTML works fine:

Quote:
<p><span style="font-weight:bold">Arrows</span>&nbsp;—&nbsp;Two points on the Enneagram that diagram the movement of stress and eustress in each Ennea-type.</p>
Or, using <b> works fine, but goes against advice to use CSS (although it is simpler).

Since I've completed coding the entire pub using the first span code, I'd rather not bloat the file using all the extra code in the second span example.

I've checked the rest of the CSS to make certain I'm not accidentally clearing the style, but the odd thing is that the same thing, but for italics, works OK.

What and I missing?

Thanks! (I'll be out until this afternoon, so I'll check back in then.)

zack
zacsmith is offline   Reply With Quote
Old 03-22-2013, 10:47 AM   #2
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,845
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
You did remember to link THAT CSS to the HTML page?

Another common reason is there is an error elsewhere in the CSS that viewer like ADE will discard the whole CSS rather than just the selector.
theducks is online now   Reply With Quote
 
Enthusiast
Old 03-22-2013, 01:21 PM   #3
mrmikel
Book Twiddler
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,086
Karma: 1444487
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Run the thing through the CSS check in Tools, Validate stylesheet and see if that helps catch any error.

BTW make sure you don't have any style commands at the top of this particular html document that cancels it out. This only likely if you brought it in from somebody else's document, like Hyperwar or other online document source.
mrmikel is offline   Reply With Quote
Old 03-22-2013, 05:12 PM   #4
zacsmith
Junior Member
zacsmith began at the beginning.
 
zacsmith's Avatar
 
Posts: 8
Karma: 10
Join Date: Oct 2012
Device: Kindle, iPhone 3GS
Just got back in. Thanks very much for the suggestions, the ducks and mrmikel. Gives me some things to check this evening. I'll report back with my results -- hopefuilly I find the cause.

zack
zacsmith is offline   Reply With Quote
Old 03-22-2013, 06:58 PM   #5
Turtle91
Guru
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 669
Karma: 3807234
Join Date: Dec 2012
Location: Shannon, Ireland today
Device: iPhone 5/iPad 1&2/Surface Pro/Kindle PW
Just wondering...I haven't tried before...can you define a class with an element that is already reserved??

.b {font-weight:bold}

when <b> is already reserved??


If it were me, I would do a S/R:
Search: <span class="b">(.*?)</span>
Replace: <strong>\1</strong>

with:
strong {font-weight:bold}

That way you keep styling out of the document and in the css, and you don't need to bloat it with extra <spans>.

Please let us know if you find the problem.

Cheers,
Turtle91 is offline   Reply With Quote
Old 03-22-2013, 07:08 PM   #6
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,845
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Turtle91 View Post
Just wondering...I haven't tried before...can you define a class with an element that is already reserved??

.b {font-weight:bold}

when <b> is already reserved??


If it were me, I would do a S/R:
Search: <span class="b">(.*?)</span>
Replace: <strong>\1</strong>

with:
strong {font-weight:bold}

That way you keep styling out of the document and in the css, and you don't need to bloat it with extra <spans>.

Please let us know if you find the problem.

Cheers,
dot b is not b
theducks is online now   Reply With Quote
Old 03-22-2013, 09:11 PM   #7
mrmikel
Book Twiddler
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,086
Karma: 1444487
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
But you can redefine b to be something else. As a test, it just made it font-size 150% instead of emphasized and it worked.

That is the beauty of CSS. You can fix a problem once in the stylesheet instead of 150 times in the text. And if you change your mind, another easy change to the stylesheet instead of 150 more corrections.

Last edited by mrmikel; 03-22-2013 at 09:20 PM.
mrmikel is offline   Reply With Quote
Old 03-22-2013, 09:48 PM   #8
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,845
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by mrmikel View Post
But you can redefine b to be something else. As a test, it just made it font-size 150% instead of emphasized and it worked.

That is the beauty of CSS. You can fix a problem once in the stylesheet instead of 150 times in the text. And if you change your mind, another easy change to the stylesheet instead of 150 more corrections.
b {font-size: 150%; font-weight: normal;}
.b {font-weight: 700}
theducks is online now   Reply With Quote
Old 03-22-2013, 11:07 PM   #9
Turtle91
Guru
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 669
Karma: 3807234
Join Date: Dec 2012
Location: Shannon, Ireland today
Device: iPhone 5/iPad 1&2/Surface Pro/Kindle PW
cool!

That kind of goes against my program-oriented background - being able to define a reserved tag as a user class (the difference between b and dot b). It certainly makes CSS more flexible. Although if I started doing that (using b and .b at the same time) I would probably confuse myself even more than I already do!!
Turtle91 is offline   Reply With Quote
Old 03-22-2013, 11:18 PM   #10
zacsmith
Junior Member
zacsmith began at the beginning.
 
zacsmith's Avatar
 
Posts: 8
Karma: 10
Join Date: Oct 2012
Device: Kindle, iPhone 3GS
Well, thanks for all the suggestions. Here are the results:

CSS is properly linked. There is only one style sheet.
I created and have been the only one to work on the file, but that's not to say I didn't introduce errors.

ADE shows the bolded words properly, but they did not show in Sigil Book View or Calibre preview.

It seems that <span> for bolding is simply not displays properly in Sigil. The "bold" button works fine, but inserts the <b> code. Oddly enough, <span> works OK for italics.

Late now, so I'll take a closer look in the morning and do some more testing on when I'm fresh.
zacsmith is offline   Reply With Quote
Old 03-22-2013, 11:21 PM   #11
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,845
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Turtle91 View Post
cool!

That kind of goes against my program-oriented background - being able to define a reserved tag as a user class (the difference between b and dot b). It certainly makes CSS more flexible. Although if I started doing that (using b and .b at the same time) I would probably confuse myself even more than I already do!!
Personally I HATE the practice of using a dot name that is 99% similar to a Tag name. It make debug a lot harder looking for a flyspeck.

<p class="p"> OMG </p>
What is wrong with para, normal, indent, title (usually centered),chapter...
theducks is online now   Reply With Quote
Old 03-22-2013, 11:38 PM   #12
zacsmith
Junior Member
zacsmith began at the beginning.
 
zacsmith's Avatar
 
Posts: 8
Karma: 10
Join Date: Oct 2012
Device: Kindle, iPhone 3GS
Using "b" is a little departure for me. Coming from a print background, I name typographic styles descriptive names so I can know what they do when I come back to a project a year later. Trying to save file space I guess.

I usually have been doing the same thing in CSS, like "anecdote-follow-nosp", etc. More bits but easier to work with, IMHO.

I do need to do some more reading on "reserved" tags, though. As a designer, this programming stuff is fun but make my eyes hurt -- I have to work to think digitally, rather than visually!
zacsmith is offline   Reply With Quote
Old 03-23-2013, 04:10 AM   #13
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: 6,193
Karma: 4800739
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Turtle91 View Post
cool!

That kind of goes against my program-oriented background - being able to define a reserved tag as a user class (the difference between b and dot b). It certainly makes CSS more flexible. Although if I started doing that (using b and .b at the same time) I would probably confuse myself even more than I already do!!
Well, it's not exactly a reserved tag, it's just a tag with some intended semantics and some default style. Also, different renderers will probably have different default styles (a text-based browser could draw it with inverted background and foreground colours, a text-to-speech system could apply some voice inflection).

Maybe <b> is not the best example, but take <em>. It's intended to mean emphasis and, although its default style is often italic, you could want to have some other style in a given document (bold, underlined, red, different font, letterspaced...). So, not only you can override default styles, but it's sometimes a good idea to re-define them, when it is important. For instance, I often use:

Code:
em { font-style: italic; }
em em { font-style: normal; }
so I make sure that <em> is italic and <em> inside <em> is not.

And you can even make a <div> behave as a <span> (display: inline) and vice-versa (display: block). But there are some XHTML restrictions that still apply (a <span> or a <p> cannot contain a <div>, for instance). Since <p> cannot contain <div>, I sometimes create a special class of <span> that behaves as <div>, and then <p> can contain this <span>
Jellby is offline   Reply With Quote
Old 03-23-2013, 05:24 AM   #14
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: 3,003
Karma: 3440001
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
If the bold shows in ADE but not in Sigil nor Calibre makes me think that you are using an older version of Sigil that still runs on Qt4. That version has some difficulties with fonts.
Never just trust solely on Sigil or Calibre to see how your book will look. ADE is much more representative.
Toxaris is offline   Reply With Quote
Old 03-23-2013, 11:50 AM   #15
zacsmith
Junior Member
zacsmith began at the beginning.
 
zacsmith's Avatar
 
Posts: 8
Karma: 10
Join Date: Oct 2012
Device: Kindle, iPhone 3GS
Quote:
If the bold shows in ADE but not in Sigil nor Calibre makes me think that you are using an older version of Sigil that still runs on Qt4. That version has some difficulties with fonts.
Never just trust solely on Sigil or Calibre to see how your book will look. ADE is much more representative.
That may be the answer, Toxaris. I am using Sigil .0.6.1 for Mac until I upgrade to the latest OSX, which means upgrades to ALL my software ($$$$).I'll be testing in some standalone readers today. but so far, ADE shows everything fine.

This discussion has given me some good idea about handling styles better....
zacsmith is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
span in span: is this problematic? tbuyus ePub 8 03-31-2013 08:01 AM
Regex and span JSWolf Sigil 7 01-23-2013 06:35 AM
how do I span more than one line with regex BartB Sigil 3 12-11-2011 05:12 PM
Remove <br /> together with span, and only span Razzia Recipes 3 05-30-2011 06:55 PM
Re Entering Title in Bold or Bold And Colour Font pricespringer Library Management 1 05-09-2011 04:45 AM


All times are GMT -4. The time now is 07:04 PM.


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