Estilos

Como Personalizar el Estilo de Nuestro Libro

You can specify CSS files to be included in your book's website or PDF builds by creating files:

  • styles/website.css: will apply only to the website
  • styles/pdf.css: will apply only to the PDF
  • styles/ebook.css: will apply only to ebook formats (PDF, Mobi, ePub)

What is CSS?

CSS stands for Cascading Style Sheets.

CSS is a language that describes how HTML elements are to be displayed on screen, paper, or in other media.

See http://www.w3schools.com to know a little about the CSS syntax.

Changing the default path to style files

These paths can be changed in the book.json configuration, for example to use file in the root folder:

{
    "styles": {
        "website": "styles/website.css",
        "ebook": "styles/ebook.css",
        "pdf": "styles/pdf.css",
        "mobi": "styles/mobi.css",
        "epub": "styles/epub.css"
    }
}

Ejemplo

Por ejemplo, en el repositorio en GitHub de este mismo libro Elaboración de Material Docente con Gitbook puede ver en el directorio styles el contenido del fichero website.css.

El estilo en este caso está para configurar los captions de las figuras, lo que se hace de acuerdo a las instrucciones del plugin image-captions.

/* CSS for website */
figure {
    /* margin: 1.5em 0px;*/
    margin: auto;
    border: 3px solid #73AD21;
    padding:10px 0;
}

figcaption {
    clear: left;
    margin: 0.75em 0px;
    text-align: center;
    font-style: italic;
    line-height: 1.5em;
}

The plugin image-captions adds nice generated captions to your book images. This plugin converts alt or title attributes of your images into the captions. Works on both the GitBook website and your own generated book (pdf, mobi).

Less y Sass

Como CSS, Less y Sass son lenguajes para la descripción de como debe mostrarse una página HTML.

Gitbook plugins exist to enable Less or Sass support.

results matching ""

    No results matching ""