[FX.php List] [off] simple CSS question

Dale Bengston dale.bengston at gmail.com
Fri Jun 28 08:06:09 MDT 2013


Hi Bob,

A variation on Andy's method is to make the second set conditional on being in a container. To wit:

a:link {
	color:#FFFFFF;
	text-decoration: none;
	font-weight: bold;
	cursor:pointer;
}
a:visited {
	text-decoration: none;
	color: #FFFFFF;
	font-weight: bold;
}
a:hover {
	text-decoration: underline;
	color:#00FF00;
	font-weight: bold;
	cursor:pointer;
}
a:active {
	text-decoration: none;
	color: #FF0000;
	font-weight: bold;
}

/*Alternate links*/

.secondary_style a:link {
	color:#DDD;
	text-decoration: none;
	font-weight: bold;
	cursor:pointer;
}
.secondary_style a:visited {
	color: #EEE;
}
.secondary_style a:hover {
	color:#FFF;
}
.secondary_style a:active {
	color: #DDD;
}

Then any links within a wrapper of <p class="secondary_style"></p> or <div class="secondary_style"></div> or <span class="secondary_style"></span> will obey the second set of rules. Any anchor tags wrapped in a container with class secondary_style will inherit attributes from your main anchor definitions, plus override anything that's different.

Hope this helps,
Dale



On Jun 27, 2013, at 2:49 PM, Joel Shapiro <jsfmp at earthlink.net> wrote:

> Hey Bob
> 
> CSS pages don't always refresh when you refresh the main (php) page.  
> 
> Try loading the CSS page directly in your browser (e.g. site.com/style.css ) and see if you see your new secondary_style stuff.  If not, reload that css page in your browser.  Then go back to your main/php page and reload that.
> 
> FWIW: It doesn't matter if a.secondary_style comes before or after a in your stylesheet -- although if you had *another* set of a.secondary_style, the set that is lower on the page would be the defining styles.
> 
> Best,
> -Joel
> 
> 
> On Jun 27, 2013, at 11:55 AM, Bob Patin wrote:
> 
>> Andy,
>> 
>> When I try it I'm not seeing what I expect, but rather the default; in my <a> link I put this:
>> 
>> <a class="secondary_style" href="link.php">HYPERLINK</a>
>> 
>> Is that how I should call it?
>> 
>> Thanks,
>> 
>> Bob
>> 
>> 
>> 
>> On Jun 27, 2013, at 1:48 PM, Andy Gaunt <andy at fmpug.com> wrote:
>> 
>>> Bob,
>>> 
>>> If you apply a class to the link then it will use that style because it has more weight in the CSS than just your regular link styling.
>>> 
>>> e.g.
>>> 
>>> a:link {
>>> 	color:#FFFFFF;
>>> 	text-decoration: none;
>>> 	font-weight: bold;
>>> 	cursor:pointer;
>>> }
>>> a:visited {
>>> 	text-decoration: none;
>>> 	color: #FFFFFF;
>>> 	font-weight: bold;
>>> }
>>> a:hover {
>>> 	text-decoration: underline;
>>> 	color:#00FF00;
>>> 	font-weight: bold;
>>> 	cursor:pointer;
>>> }
>>> a:active {
>>> 	text-decoration: none;
>>> 	color: #FF0000;
>>> 	font-weight: bold;
>>> }
>>> 
>>> New class for alternate links.
>>> 
>>> a.secondary_style:link {
>>> 	color:#DDD;
>>> 	text-decoration: none;
>>> 	font-weight: bold;
>>> 	cursor:pointer;
>>> }
>>> a.secondary_style:visited {
>>> 	color: #EEE;
>>> }
>>> a.secondary_style:hover {
>>> 	color:#FFF;
>>> }
>>> a.secondary_style:active {
>>> 	color: #DDD;
>>> }
>>> 
>>> 
>>> 
>>> Cheers
>>> 
>>> - Andy
>>> 
>>> On Jun 27, 2013, at 2:39 PM, Roger Moffat <rogerkiwi at mac.com> wrote:
>>> 
>>>> 
>>>> On Jun 27, 2013, at 2:14 PM, Bob Patin wrote:
>>>> 
>>>>> Solved... I just wrapped the link in a SPAN tag.
>>>>> 
>>>>> Is there a way to do it in the stylesheet instead? In other words, could I have a separate of link definitions that I could invoke on desired links?
>>>> 
>>>> If on that one page you can call another stylesheet after the first one, then you can put the differences in to a second stylesheet, and only that page would call it.
>>>> 
>>>> Roger_______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>> 
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list