Clarification Re: paragraph without CSS styles

Learn / Forums / EPUB and eBook / Clarification Re: paragraph without CSS styles

Tagged: 

Viewing 3 reply threads
  • Author
    Posts
    • #91527

      First, I just finished watching your InDesign tutorial series, and it convinced me to subscribe to Lynda.com. I took notes on the videos and am now going back and reviewing some of my questions…and this is the first one…

      Did you say in one of the videos that allowing html elements without CSS classes is a bad practice?

      I would like to follow a three-step process in styling my paragraphs, as follows:

      1. All paragraph tags have no classes assigned by default. They will simply be styled with a CSS rule in the style sheet that looks something like this:

      p { indent: 15px; }

      2. Paragraph tags in the Appendix will be styled a little differently. However, they still won’t have a class; they will simply be placed inside special div’s. The style sheet will then include a second rule:

      div.footnote p { indent: 0; etc. }

      3. Any paragraphs that require special styling will then be assigned classes, and appropriate styles will be added to the style sheet as needed.

      To ask my question another way, is what I described a good practice, or is it a bad practice to include paragraph tags without CSS classes (as you may have commented on in one of the videos).

      I also have one similar question: My content will certainly include bold and italicized text. Is it OK to use conventional tags – [b] [em] – or do I have to use styles to accomplish this? Again, I’m a little confused, because I have something in my notes about using CSS styles instead of bold/italics tags. But I can’t remember exactly where in which video I might have heard that.

      Thanks!

    • #91529
      David Blatner
      Keymaster

      David: I’m assuming you mean Anne-Marie’s videos? She is out on holiday at the moment. But are you talking about building these epubs from scratch, or with InDesign? I think InDesign always adds classes; that might be what she was saying.

    • #91531

      David B. is correct! It was possible in previous versions of InDesign to skip those classes, if not needed. So in every case you will get classes (name of your style) for box- and inlineelements.

      It seems, that you are familiar with html and css and it is good practice to avoid those ugly css from InDesign and write your own styles. It is not a problem, if the classes are in the html, but if you want to have clean html, I do the following:

      1. Tag all unwanted classes with a class “remove”
      2. Do an search and replace e.g. in BBEdit (it is important to have Multifile-Search with GREP) and remove > classe=”remove”;

      Maybe a word to things like: div.footnote p { indent: 0; etc. }
      This depends on your reader. It may happen, that a reader does only honor styles, that are attached directly to the element.

      Kai

    • #91566

      Thanks for the tips. Yes, I’m using InDesign, but I’m also going to be tweaking the CSS manually. I was planning on buying BBEdit, too, so I’ll go ahead and get it and jump into action.

      Thanks again.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
>