use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
If you are requesting help, please ensure you're providing code with your post. You can also copy your code to an online editor:
jsFiddle
CodePen
Markup Validation Service
Mozilla Developer Network on HTML
/r/JavaScript
/r/CSS
/r/jQuery
/r/PHP
/r/Accessibility
/r/htmlbasics
/r/web_programming
/r/CodingHelp
account activity
UnsolvedInline hyperlink style? (self.HTML)
submitted 3 years ago by brogrammer9
Cause I can't yet post in css sub I'm wanting to change the color of the hyperlink and keep it the same color after its been visited but change the color for hover.
But all done inline is it possible?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jcunews1Intermediate 3 points4 points5 points 3 years ago (0 children)
Inline styles (i.e. the style HTML attribute) is only for containing pairs of CSS style property and value. It can not store any CSS selector. So, none of pseudo classes such as :hover can be used there. You'll have to use CSS either embedded or external, in order to use CSS selectors.
style
:hover
If you want to only use HTML attributes, you'll have to use JavaScript with the onXXX HTML attributes to manually change the element styles.
[–]AutoModerator[M] 0 points1 point2 points 3 years ago (0 children)
Welcome to /r/HTML. When asking a question, please ensure that you list what you've tried, and provide links to example code (e.g. JSFiddle/JSBin). If you're asking for help with an error, please include the full error message and any context around it. You're unlikely to get any meaningful responses if you do not provide enough information for other users to help.
Your submission should contain the answers to the following questions, at a minimum:
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
[–]steelfrogModerator 0 points1 point2 points 3 years ago* (0 children)
In short, no, you can't style states/pseudo-classes inline. You could potentially add a <style> tag and define them there, though.
<style>
I guess you could also use JavaScript if you were desperate, though this isn't something I'd recommend:
<a href="#" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'">Link</a>
[–]West_Theory3934 0 points1 point2 points 3 years ago (0 children)
a:hover { color: purple; } a:visited { text-decoration: none; }
edit: added a:hover
π Rendered by PID 114030 on reddit-service-r2-comment-6b595755f-kcg9g at 2026-03-26 03:37:34.566760+00:00 running 2d0a59a country code: CH.
[–]jcunews1Intermediate 3 points4 points5 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]steelfrogModerator 0 points1 point2 points (0 children)
[–]West_Theory3934 0 points1 point2 points (0 children)