"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."

Go Back   Webmaster Forums > Code Forum > CSS Forum

Reply
 
Thread Tools Rate this Webmaster Discussion
Old 06-22-2009, 07:39 AM   #1
wcipolli
Junior Member
 
Join Date: Jun 2009
Webmaster Discussions: 28
Rep Power: 8
wcipolli is on a distinguished road
How to override CSS styling in one part of webpage

CODE IN JSP THAT DYNAMICALLY PRINTS SEARCH RESULTS THAT I WOULD LIKE TO HAVE A DIFFERENT FORMAT:

Code:
						
<hx:outputLinkEx styleClass="outputLinkEx" id="formPdfLink"
	onclick="return openPDFWord(this, '#{varsearchResults.targetURLForPDF}');"
	value="#{varsearchResults.pdfURL}">
	<h:outputText styleClass="outputText" id="text7"
	value="#{varsearchResults.formIdAndEditionDate}"
	escape="false"></h:outputText>
</hx:outputLinkEx>
CODE IN CSS THAT DEFINES LINKS:

Code:
a:link {color:#52658C;}
a:visited {color:#52658C;}
a:hover {color:#CC0000;}
a:active {color:#52658C;}
I would like to have the links printed from the code above to show when they have been visited. The PDF's open in a new window, does this mean the code would have to be executed on an onclick?

Stuck, I tried messing with the code:
<hutputText style="color:red;"
this makes just those links red. I tried vlink=#CC0000 which didn't work

Any help would be greatly appreciated.. I tried 3 forums to no avail

Regards,
Will


wcipolli is offline   Reply With Quote
Old 06-22-2009, 09:14 AM   #2
jthayne
 
jthayne's Avatar
 
Join Date: Aug 2008
Location: Texas
Webmaster Discussions: 501
Rep Power: 21
jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.
Re: How to override CSS styling in one part of webpage

If you are wanting the link to be a different color when it has been visited, all you need to do is change the a:visited in your CSS to be a different color than a:link.
__________________
Be sure to click the reputation icon to give rep to the person who helped you.
For web design/development services, check Silentium Designs.
jthayne is offline   Reply With Quote
Old 06-22-2009, 10:05 AM   #3
wcipolli
Junior Member
 
Join Date: Jun 2009
Webmaster Discussions: 28
Rep Power: 8
wcipolli is on a distinguished road
Re: How to override CSS styling in one part of webpage

I want just those links printed by that block of code to show visited. The vlink is set to the same color because i dont want any of the other links to show that they are visited.
wcipolli is offline   Reply With Quote
Old 06-22-2009, 02:40 PM   #4
jthayne
 
jthayne's Avatar
 
Join Date: Aug 2008
Location: Texas
Webmaster Discussions: 501
Rep Power: 21
jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.
Re: How to override CSS styling in one part of webpage

Sorry about that. I didn't catch that you wanted the links to be different across the page. The same principle applies though. As long as the code was set up correctly, you will style the outputLinkEx class.

For example, make the following changes to your CSS file:
Code:
a:link {color:#52658C;}
a:visited {color:#52658C;}
a:hover {color:#CC0000;}
a:active {color:#52658C;}

a.outputLinkEx:link {color:#52658C;}
a.outputLinkEx:visited {color:#FF0000;}
a.outputLinkEx:hover {color:#CC0000;}
a.outputLinkEx:active {color:#52658C;}
The visited PDF links should be red while the rest remain as before.

For reference, check here.
__________________
Be sure to click the reputation icon to give rep to the person who helped you.
For web design/development services, check Silentium Designs.
jthayne is offline   Reply With Quote
Old 06-22-2009, 02:59 PM   #5
wcipolli
Junior Member
 
Join Date: Jun 2009
Webmaster Discussions: 28
Rep Power: 8
wcipolli is on a distinguished road
Re: How to override CSS styling in one part of webpage

No dice. Still not showing visited links. I was thinking about trying to span.. but that was unsuccessful too. I'm assuming because outputText uses span, I don't think you can span a span?
wcipolli is offline   Reply With Quote
Old 06-22-2009, 03:10 PM   #6
wcipolli
Junior Member
 
Join Date: Jun 2009
Webmaster Discussions: 28
Rep Power: 8
wcipolli is on a distinguished road
Re: How to override CSS styling in one part of webpage

from my understanding of the code. outputLinkEx allows the js to get the search result values and outputText prints the actual link...

when I threw in style="color:red;" next to outputText all the links turned red

i tried style = "vlink:red" but wasn't lucky enough for that to work.
wcipolli is offline   Reply With Quote
Old 06-22-2009, 05:41 PM   #7
jthayne
 
jthayne's Avatar
 
Join Date: Aug 2008
Location: Texas
Webmaster Discussions: 501
Rep Power: 21
jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.
Re: How to override CSS styling in one part of webpage

In the code I gave you, try changing outputLinkEx to outputText.
__________________
Be sure to click the reputation icon to give rep to the person who helped you.
For web design/development services, check Silentium Designs.
jthayne is offline   Reply With Quote
Old 06-23-2009, 06:57 AM   #8
wcipolli
Junior Member
 
Join Date: Jun 2009
Webmaster Discussions: 28
Rep Power: 8
wcipolli is on a distinguished road
Re: How to override CSS styling in one part of webpage

Still not working. I feel like it has a lot to do with the PDFs opening in a new window.
wcipolli is offline   Reply With Quote
Old 06-23-2009, 07:37 AM   #9
wcipolli
Junior Member
 
Join Date: Jun 2009
Webmaster Discussions: 28
Rep Power: 8
wcipolli is on a distinguished road
Re: How to override CSS styling in one part of webpage

i also tried:

.outputText a:link...

and

#outputText a:link...

and

.outputLinkEx a:link...

and

#outputText a:link...

none of which worked
wcipolli is offline   Reply With Quote
Old 06-23-2009, 08:53 AM   #10
jthayne
 
jthayne's Avatar
 
Join Date: Aug 2008
Location: Texas
Webmaster Discussions: 501
Rep Power: 21
jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.
Re: How to override CSS styling in one part of webpage

If you remove all CSS formatting of the a element, does the link show as a different color after you click on it?

Also, what browser are you viewing it in?
__________________
Be sure to click the reputation icon to give rep to the person who helped you.
For web design/development services, check Silentium Designs.

Last edited by jthayne; 06-23-2009 at 09:20 AM. Reason: additional question added
jthayne is offline   Reply With Quote
Reply

Bookmarks

Tags
css, override, styling

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Webmaster Discussions
Thread Webmaster Discussion Starter Forum Replies Last Post
Scroll bar for part of page cokesodanotd HTML Forum 1 04-12-2004 06:45 AM
Insert a Webpage within a Webpage without Frames ?? Samoyed PHP Forum 1 12-16-2003 04:52 PM
Table Woes part 2 Gimik HTML Forum 9 03-04-2002 08:36 PM


All times are GMT -5. The time now is 08:58 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.