I have a line where I add some css:
$("#foo").html("Some text with a link <a href=\"link.html\">Link here</a>").css({
'margin': '10px 0px',
'padding': '15px 10px 15px 50px',
'clear': 'left'
});
I want to change the link to the color black, so adding this css should work:
a.link {
color: black
}
I guess the best thing to do is point to a css file instead of adding a.link. But wondering if it is possible. Obviously something like this doesn’t work as it is not the proper json format:
$("#foo").html("Some text with a link <a href=\"link.html\">Link here</a>").css({
'margin': '10px 0px',
'padding': '15px 10px 15px 50px',
'clear': 'left',
'a:link: color': 'black'
});
Is there a way to do this?
Why not insert a style tag with needed styles?
<style type="text/css">a.link: {color: black}</style>or define link color inline.cssis used to defined inline css styles, not styles by selectors, likea.link, use<style>tag for that.