0

I have an array which i pass into my views and contains all the needed data...

It also includes the user profile data with a link key and its color as value...

How can i pass it into the CSS in color selector in order to print the desired color for each user?

1 Answer 1

2

Your question is not really rich in details, but you can do that using inline styles:

Use it in the head:

<style type="text/css">

#yourdiv{
   color: #<?php echo $color;?>
}

</style>

Or simply inline:

<div style="color:#<?php echo $color;?>"> Lorem ipsum </div>
Sign up to request clarification or add additional context in comments.

1 Comment

That with the head works best as i see in other sites as well. thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.