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

199
Visualizações
How to add inline css to html

I want to add some inline styles to my html website. I have my css code in a style file called copy.css. (As a background, I can tell that I am doing this because I want to put a big portion of code inline, and also I want to be able to have different inline css depending on my URL page. So having separate css files makes it more neat and manageable). The code inside my css file copy.css is now only:

/*  My inline styles  */

So, the result I want to get in my html is:

<style>/*  My inline styles  */</style> 

I DO NOT want to get this code into my html (because it is a href and not a true inline):

<link rel='stylesheet' id='copy-css'  href='https://www.HIDDEN.se/wp-content/themes/guru/copy.css?ver=6.0' type='text/css' media='all' />

The above <link ... /> code is generated by this code in a php file:

<?php 
function add_custom_css() {
    wp_enqueue_style('copy',  get_template_directory_uri() . '/copy.css');   
}
add_action( 'wp_enqueue_scripts', 'add_custom_css' );
?>

I have also tried using wp_add_inline_style but can not figure it out...all I do is to fetch the href and not the content of copy.css.

about 4 years ago · Juan Pablo Isaza
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