How can I define style sheet within style attribute of anchor tag with active, hover, visited? I don’t want to define external css styleseet or in page head tag. LIKE <A HREF="/test.html" STYLE=".....WANT TO DEFINE HERE......"> Test Link</A> Please help.
You can't use CSS pseudoclasses in inline link styles, you would have to use embedded CSS or external CSS.
You can't do it with inline styles the CSS spec doesn't allow it the only way would be embedded CSS or external CSS. Now if you wanted to apply the CSS to only one link element on each page then add the "id" attribute to the opening anchor tag and in your embedded/external CSS put: #nameofid a:link { color: red; } #nameofid a:visited { color: green; } Code (markup): If you wanted to apply the style to multiple links then use the "class" attribute and replace the # in your CSS with a .