473,651 Members | 2,775 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Associating link colour within another class.

Hello,

Is there a way of associating what colour the hyperlinks should be within a
particular class?

Let me elaborate:

I am using programming to generate HTML code. I want different sections of
the webpage to be coloured differently depending on variables in my code and
I use CSS classes to achieve this.

Therefore a loop like follows

Do while condition = true
if (ChosenColour = green) then
print "<TR CLASS='COLOURCL ASS_GREEN'"
if (ChosenColour = red) then
print "<TR CLASS='COLOURCL ASS_RED'"
etc....
Loop

However,
within the class COLOURCLASS_<WH ATEVER COLOUR> I also want to define the
hyperlink colours.

Therefore I would also want to set the hyperlink colours within that
particular table row and control what colour a Hyperlink is from within
COLOURCLASS_<WH ATEVER COLOUR>

At present it seems that I have to apply the class to each particular <A
href=""> </a> that occurs and this makes my programming a bit more difficult
and a bit more messy.

I hope I have made what I am trying to achieve clear and if so I hope
someone can help me find a way of associating control of hyperlink colours
to different regions of a HTML page, without needing to apply a specific
class to each <A> tag.

Kind regards

Dave
Jul 21 '05 #1
2 3448
"Dave Smithz" <SPAM FREE WORLD> wrote:
Is there a way of associating what colour the hyperlinks should be within a
particular class?
Yes.
..classname a:link {color: #rrggbb; background-color: #rrggbb;}
and likewise for the other pseudo classes.
At present it seems that I have to apply the class to each particular <A
href=""> </a> that occurs and this makes my programming a bit more difficult
and a bit more messy.


Not at all, see above.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 21 '05 #2

"Steve Pugh" <st***@pugh.net > wrote in message
news:hn******** *************** *********@4ax.c om...

Yes.
.classname a:link {color: #rrggbb; background-color: #rrggbb;}
and likewise for the other pseudo classes.


Ahhhh, EURKEA!!!!!

Thanks for the rapid response.

The style sheets are not that bad (or darn good to put it another way). Why
did I put off learning them for two years!!!!!!

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1936
by: Mark | last post by:
Hi - in my current pages, I have: <link href="styles.css" rel="stylesheet" type="text/css"> What I would like to do is: <!--#include file="config.asp" --> <!--#include file="styles.asp" --> config.asp read values from a database, which are used to populate colours within the styles.asp sheet - for example, styles.asp looks
1
1374
by: WindAndWaves | last post by:
Hi Gurus and Folk I have the following line of code: <A HREF="#fac" CLASS="m" ONCLICK="showD('bas','fac');this.blur();return false;">show information</A> the showD function shows a div. People without Javascript are linked to the #fac bookmark.
18
10279
by: Denny Schierz | last post by:
hi, i want to change my link colors in the p class="suchen": That is my html: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//DE" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
4
2150
by: Lachlan Hunt | last post by:
Hi, I'm looking for an interoperable method of determining the current background colour of an element that is set using an external stylesheet. I've tried: elmt.style.backgroundColor; but that only works if the colour has been set using the style attribute or previously set using script. I've also tried:
3
4124
by: Fuzzyman | last post by:
Hello all, I'm using a website creation tool (called `rest2web <http://www.voidspace.org.uk/python/rest2web/>`_) that lets me store my content in a text based format ( `ReStructuredText <http://docutils.sf.net>`_ and inserts the *generated* HTML into a template. When it creates the HTML for an image which is also a link, it generates the following :
0
1784
by: llarryllama | last post by:
I'm using this script (see below) that I found here on thescripts and it's working perfectly. It's to change text color of a "visited link" back to unvisited color. The problem is that to make the visitor understand the structure of the navigation, the top link has to be it's active colour on page load. I've tried a script that makes a link active on page load but it also creates an ugly frame around it and also makes this script a bit buggy....
3
1718
by: bg_ie | last post by:
Hi, Lets say I have a TreeView with nodes that represent objects of a number of different types. Is there a way of associating the Set method of each object with its node in the TreeView? That way when you select a node in order to change its associated data, you have easy access to its Set function. The way I normally handel this situation is is to create an enum of all the different types that the treeview contains. I then have a
6
2705
Robbie
by: Robbie | last post by:
Hi. I've made 2 functions which play around with colours. They convert a 'colour number' (I don't know what the proper name for it is, so I call it this - the Long given back by RGB(), object.BackColor, etc, which represents a value of red, green and blue) into another 'colour number' but this is a greyscale version of it. There are 2 functions - the first one 'decodes' the 'colour number' into the separate R G and B values. The second one...
1
2135
by: Taftheman | last post by:
Hi i have changed the style of a link button in CSS. Origanlly I changed the linkbutton colour to dark green and hover to red. This worked great. But now i have changed the linkbutton colour to violate blue. The problem I am having is that even tho this works fine, once the link has been visited it changes back to dark green. I have also messed around with using the visited attribute for the link buttons, but then my hover doesn't work once the...
0
8357
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8803
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8700
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8581
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.