Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

220
Vistas
TinyMCE - style: insert date time plugin - font / size

Can anyone tell me how, or if, I can style the text inserted by the TinyMCE insertdatetime plugin?

Specifically, I'd like to set the font size to smaller than the rest of the text.

I'm also wondering if doing so might cause a problem for subsequent typed text, because it would continue with the different font size?

This is what I'm using now:

insertdatetime_formats: [ '✏️ (%d/%m/%Y  -  %Hh%M)', '%d/%m/%Y' ],

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

One way to do this is to wrap the date/time string in a <time> element using insertdatetime_element: true, then style that <time> tag with content_style. As you said, this does create a problem where the text will remain smaller if you continue typing (until you hit the Enter key).

As a workaround, you can use noneditable_noneditable_class and extended_valid_elements to add the noneditable class to the <time> tag (if it doesn't need to be editable) and any text typed after that will go back to the default style.

Example fiddle: https://fiddle.tiny.cloud/LShaab/3

tinymce.init({
    selector: "textarea",
    plugins: [
        "insertdatetime noneditable"
    ],
    insertdatetime_formats: ['(%d/%m/%Y  -  %Hh%M)', '%d/%m/%Y'],
    insertdatetime_element: true,
    content_style: "time { font-size:11px; }",
    noneditable_noneditable_class: 'mceNonEditable',
    extended_valid_elements: 'time[class=mceNonEditable]'
});
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda