Im trying to change the link colours in my header section in wordpress but the below code isn't working....any ideas?
//Change link colours
add_action('wp_head', 'insert_some_css');
function insert_some_css() {
echo <style type="text/css">
a {
color: #08FF00; /* green */
text-decoration: none;
}
a:hover {
color: #FF0000; /* red */
text-decoration: underline;
}
</style>
}
<?php
add_action('wp_head', 'insert_some_css');
function insert_some_css() {
echo "<style type=\"text/css\">
a {
color: #08FF00; /* green */
text-decoration: none;
}
a:hover {
color: #FF0000; /* red */
text-decoration: underline;
}
</style>";
}
You can use like:
echo "<p style='color:red;'>".$ip['city_name']."</p>";
echo "<p style='color:red;'>".$ip['country_name']."</p>";
It is not a good idea to echo HMTL tags and CSS styling with PHP please write your CSS to header of the file not in PHP tag or if you have to use that you should put everything in " ".
<style>
a {
color: #08FF00; /* green */
text-decoration: none;
}
a:hover {
color: #FF0000; /* red */
text-decoration: underline;
}
</style>