# Applying a CSS style to a group of dynamically generated links?

**URL:** <https://forum.kirupa.com/t/applying-a-css-style-to-a-group-of-dynamically-generated-links/119345>\
**Category:** Uncategorized\
**Created:** [August 13, 2004, 5:20pm UTC](https://forum.kirupa.com/t/applying-a-css-style-to-a-group-of-dynamically-generated-links/119345 "2004-08-13T17:20:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaelle](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jaelle](https://forum.kirupa.com/u/jaelle)\
**Post date:** [August 13, 2004, 5:20pm UTC](https://forum.kirupa.com/t/applying-a-css-style-to-a-group-of-dynamically-generated-links/119345/1 "2004-08-13T17:20:41Z")

</div>

I’m currently fighting w/ learning how to use a shopping cart system called eDatCat, and customizing it to a design i have in mind. Unfortunately, I do not have much knowledge of CSS, as I have never needed it much before last week. However, it does seem very useful for this current project so I’m doing my best. One small problem tho. The shopping cart system dynamically generates the html links in the menus, and they seem to have it very well hidden for where I can go in and edit the \<a\> tag to say \<a class=“navigation” … \> So, I thought perhaps I could apply a style to a \<span\> tag that surrounds them, and set up the properties for the links through there. With the help of [w3schools.com](http://w3schools.com) I came up w/ this lovely piece of code that I was rather proud of:

```auto
.links
	{
	color:#FF6600;
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
	font-weight:bolder;
	}
.links > a:link 
	{
	color:#FF6600;
	text-decoration:none;
	}
.links > a:visited 
	{
	color:#FF6600;
	text-decoration:none;
	}
.links > a:active
	{
	color:#FFFFFF;
	text-decoration:none;
	}
.links > a:hover 
	{
	color:#FFFFFF;
	text-decoration:none;
	}

```

It appears to work in Dreamweaver, and aparently it work nicely in Mozilla, but in IE, it does not work at all ☹ Does anyone know of another way I can approach this that might be more IE friendly?

---

<div class="post-metadata">

**Author:** ![DDD](https://avatars.discourse-cdn.com/v4/letter/d/9fc348/32.png) [@DDD](https://forum.kirupa.com/u/DDD)\
**Post date:** [August 13, 2004, 5:43pm UTC](https://forum.kirupa.com/t/applying-a-css-style-to-a-group-of-dynamically-generated-links/119345/2 "2004-08-13T17:43:17Z")

</div>

not sure why the “\>” is there. But how are you linking the style sheet?

How I would do it is

```php
A.links {
    css here
}

A.links:hover {
    css here
}

```

And that works in all browsers that I have tested.

---

<div class="post-metadata">

**Author:** ![jaelle](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jaelle](https://forum.kirupa.com/u/jaelle)\
**Post date:** [August 13, 2004, 7:03pm UTC](https://forum.kirupa.com/t/applying-a-css-style-to-a-group-of-dynamically-generated-links/119345/3 "2004-08-13T19:03:12Z")

</div>

that won’t work because so far as I can tell, because the shopping cart system dynamically generates the html for the links, I cannot make them say:

```html
<a class="links">

```

so doing what you suggest does not help.

I was trying to incorporate the \> from what I saw here @ w3schools:

> [@http://www.w3schools.com/css/css\_pseudo\_classes.asp](#):
>
> ```html
> div > p:first-child
> {
> text-indent:25px
> }
> 
> ```

If i’m using it in the wrong way, please tell me. They didn’t seem to explain it much.

My goal is to be able to write this in the HTML:

```html
 <span class="links">%%subcat_list%%</span>

```

\*%%subcat\_list%% is something like (and CANNOT be changed):

```html
<a href="somelink.html">Blah</a><a href="somelink2.html>Blah 2</a>

```
