Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

221
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda