# Calling a CSS Class within Another CSS Class

**URL:** https://forum.kirupa.com/t/calling-a-css-class-within-another-css-class/196835
**Category:** web dev
**Created:** [August 11, 2006, 9:25am UTC](https://forum.kirupa.com/t/calling-a-css-class-within-another-css-class/196835 "2006-08-11T09:25:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![silverType](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@silverType](https://forum.kirupa.com/u/silverType)
#### Post date: [August 11, 2006, 9:25am UTC](https://forum.kirupa.com/t/calling-a-css-class-within-another-css-class/196835/1 "2006-08-11T09:25:58Z")

</div>

Hi guys,  
I’d like to find out that whether if it’s possible to call a css class within another css class.  
For instance, I’ve declared a class called ‘linktxt’ which will be applied to a link. I have also declared another class for an image called ‘bg’. When I rollover the link, bg should change from one image to the other.

```auto

.bg{
	background-image: url(images/arrow.gif);
}

.linktxt a:hover{
            <!-- Background image of the .bg class changes to url(images/arrow_over.gif) -->
}

```

Any idea how I should come about doing that?
