Skip to main content.
home | support | download

Back to List Archive

Swish-E and CSS

From: Phil Matt <philm(at)>
Date: Thu Apr 15 2004 - 17:21:47 GMT
I wrote:

> > When I turned to the routine that formats each single result,
> > specifically the <dl> that handles the listing of each result, I find
> > that styles called do not work, although I can declare:  
> > 
> > <dd style="width:65%; background-color: #DCEDED">
> > 
> > and the styling works as expected. If I use "<dd class="mystyle"> or <dd
> > id="mystyle"> the styling isn't applied.

Bill Moseley wrote:
> I don't know style sheets very well -- I have spent hours trying to
> figure out why something doesn't work.  I wish there was a browser
> feature to explain how it decides what style to use and how it came to
> that choice.  That would make debugging much easier.
> Are any styles applied to the <dd> tags?

Generally, the problem with styles is that an already declared style higher up in the 
cascade is styling an element, and when you want to change the element's styling, you 
have to override whatever is already in place.

By declaring something like:

<td id="special">whatever content</td> you can get what you want, as the specificity of 
ID will take precedent over an inherited class style.

The current release of Dreamweaver MX has a neat little feature which will show you the 
particular piece of CSS that is in force for anything in a document. Very useful, but I 
never bothered to upgrade since I really write most of my sites in more or less straight 
code. I  write my styles in a plain vanilla environment - Homesite, which just color codes 
the CSS text as you write it - easy to spot typos.

The template file now has:

<dt style="background-color: #DCEDED; width:60%">$this_result->{swishreccount} <a 
href="$this_result->{swishdocpath_href}">$title</a> <small>-- rank: 
<dd style="width:55%; font-size:11px">$description  $props   </dd>

I will give the CSS another go later, as if I can apply styles manually, using the already 
called stylesheets has to be possible.

Cheers --- Phil
Received on Thu Apr 15 10:21:47 2004