inherit
252032
0
Apr 4, 2024 21:43:14 GMT -8
Retread
Tribbial Pursuit.
5,014
January 2018
retread
|
Post by Retread on Jan 26, 2018 7:25:47 GMT -8
Not sure if I worded the title correctly. What I'd like to do with a link in a post like this: Schematics Library[a href="http://guitarnuts2.proboards.com/thread/8129"][font color="ff0000" face="trebuchet ms" size="2"]Schematics Library[/font][/a] Is to have the text change color when the cursor hovers over it. Or is that beyond what BBCode can do?
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,775
January 2015
msg
|
Post by Lynx on Jan 26, 2018 9:38:15 GMT -8
IGNORE THIS POST - the information is NOT correct!
Here's a way to achieve that: Simply add a class to your anchor tag, then you can use CSS to style it. Using your link above, you could do something like:
[a class="myClass" href="http://guitarnuts2.proboards.com/thread/8129"][font color="ff0000" face="trebuchet ms" size="2"]Schematics Library[/font][/a]
then, in your stylesheet (or global header if surround by style tags):
.myClass a:hover { color: #000000; }
Change the #000000 to whatever color you want.
|
|
inherit
252032
0
Apr 4, 2024 21:43:14 GMT -8
Retread
Tribbial Pursuit.
5,014
January 2018
retread
|
Post by Retread on Jan 26, 2018 11:03:49 GMT -8
LynxDoes it matter where in the stylesheet I place that? I copy/pasted what's in your second code box into the very end of the current style sheet and saved it. I copy/pasted what's in your first code box into a post. No joy. Looks the same as before, but no change (I expected a change to black) when the cursor hovers over the text.
|
|
#e61919
Support Staff
224482
0
1
Apr 18, 2024 14:32:13 GMT -8
Scott
23,254
August 2015
socalso
|
Post by Scott on Jan 26, 2018 14:31:49 GMT -8
Retread, did you put the css code in the right theme's css?
|
|
inherit
252032
0
Apr 4, 2024 21:43:14 GMT -8
Retread
Tribbial Pursuit.
5,014
January 2018
retread
|
Post by Retread on Jan 26, 2018 15:39:30 GMT -8
Scott, that sounds like a mistake a new guy like me might make. Not this time, though. To confirm I was on the right theme, I removed code I had previously added to make a button for the spoilers.
.spoiler_header>a{color:#000000;font:12px Trebuchet,Arial;background-color:#dadada;background-image:url('http://images.proboards.com/v5/gradients/light.png');background-repeat:repeat-x;background-position:center center;border:1px solid #a7a7a7;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;min-height:20px;line-height:20px !important;padding:2px 4px;display:inline-block;vertical-align:middle;cursor:pointer;white-space:nowrap;} .spoiler_header>a:hover{color:#333333;font:12px Trebuchet,Arial;text-decoration:none;background:#e7e7e7 url('http://images.proboards.com/v5/gradients/top-light-40-trans.png') center repeat-x;border:1px solid #a7a7a7;}
Then saved changes and refreshed the tab where the post is. Spoiler now has no button. So it's the right theme.
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,852
December 2005
horace
|
Post by Chris on Jan 26, 2018 20:27:17 GMT -8
I'll have to disagree with Lynx on this one (which is surprising): BBCode does not support class attributes, if in doubt as to what is and is not supported you can easily test this by writing out your BBCode then switch to the preview tab which will send off your BBCode for evaluation and return with a corrected version containing only what is supported. Switch back to the BBCode tab to see the corrected version which will undoubtedly strip away any mention of class. That said, even if it did support class then the given CSS selector calls for a parent of the anchor tag to have the class not the anchor tag itself as was stated in the given instructions. BBCode does however support other attributes which can be used for targeting specific anchor tags: [a class="myClass" href="http://guitarnuts2.proboards.com/thread/8129"][font color="ff0000" face="trebuchet ms" size="2"]Schematics Library[/font][/a] The solution depends on the desired criteria so let's say for example you want all posted links that contain a direct font child element with the color set to red to become blue when hovered the following CSS rule added to the stylesheet should accomplish that .message a>font[color="ff0000"]:hover, .message a>font[color="red"]:hover{ color: #0000ff; } If your criteria is a bit more precise, perhaps by wanting only links that point to the thread with the identifier of 8129, or a bit less precise (any font colored link), then that would result in a different constructed solution. #detailsmatter
|
|
inherit
252032
0
Apr 4, 2024 21:43:14 GMT -8
Retread
Tribbial Pursuit.
5,014
January 2018
retread
|
Post by Retread on Jan 26, 2018 23:42:32 GMT -8
I'll have to disagree with Lynx on this one (which is surprising): It surprises me, as well. I've read several of MSG's replies to others and I was able to solve a few issues I was having without needing to ask. Works as-advertised. At first I was thinking any font colored link. But now I think specific colors might be better. I take it, I could clone this line of code for links of a few specific colors, each having a different color associated with it, on hover. I reckon the key is the named color is an identifier of sorts. That would need to be different for each specific color? That's a most interesting feature. I never previewed what MSG gave me. After posting, and returning to the BBCode editor, it remained intact. But just now I switched to preview mode then back to BBCode. Sure enough, it was corrected. Thank you, Chris. Who's awesome? You are!
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,852
December 2005
horace
|
Post by Chris on Jan 27, 2018 4:52:43 GMT -8
You're welcome At first I was thinking any font colored link. But now I think specific colors might be better. I take it, I could clone this line of code for links of a few specific colors, each having a different color associated with it, on hover. I reckon the key is the named color is an identifier of sorts. That would need to be different for each specific color? The named color serves no special purpose except as a readily recognizable identifier if you had several such rules gumming up the works as you suggested, I only included it in case someone decided to use the named color than the hex equivalent thus covering a bit more bases (an attribute match for "ff0000" would not match "red" so included both)
|
|
#e61919
Support Staff
224482
0
1
Apr 18, 2024 14:32:13 GMT -8
Scott
23,254
August 2015
socalso
|
Post by Scott on Jan 30, 2018 10:30:43 GMT -8
I'll have to disagree with Lynx on this one (which is surprising): It surprises me, as well. I've read several of MSG's replies to others and I was able to solve a few issues I was having without needing to ask. Hey, we all have our days
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,852
December 2005
horace
|
Post by Chris on Jan 31, 2018 12:36:43 GMT -8
Hey, we all have our daze 00100011 01101101 01100101 00110010
|
|
#e61919
Support Staff
224482
0
1
Apr 18, 2024 14:32:13 GMT -8
Scott
23,254
August 2015
socalso
|
Post by Scott on Jan 31, 2018 12:38:10 GMT -8
Hey, we all have our daze 00100011 01101101 01100101 00110010 01101100 01101111 01101100
|
|