Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!