Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Question about CSS

Reply
Thread Tools

Question about CSS

 
 
Sonnich Jensen
Guest
Posts: n/a
 
      09-12-2007
Hello

I am not an expert in this, hence the question:

I have code like this:

CSS:
td { font-family: Verdana, Arial, Helvetica, sans-serif; color:
#333333; text-decoration: none; font-size: 12px }
..aa { font-family: Verdana, Arial, Helvetica, sans-serif; color:
#990000; text-decoration: none; font-size: 12px; cursor: hand; }
..aa:hover { font-family: Verdana, Arial, Helvetica, sans-serif; color:
#000066; text-decoration: none; font-size: 12px; cursor: hand; }

and html:
<tr class='aa' ....

problem: the css is a greater part of a project, so I cannot change
all what I want in there.
The "aa" is my idea, it is for a clickable table, which works well -
idea: the entire row should change from red to blue when clicked.

The problem is "color: #333333;" - once I remove that, it works as
requested. So, how do I override that colour code up there?
As I mentioned, I cannot remove it, so I have to override it somehow.
I recall playing with it, and problems, where refreshing was an issue,
IE keeps CSS files beyond history. It has worked once, then I changed
the name... and it did not work any more. I am not sure what I did
back then, but I have not been able to recreate it.

Can anyone help me here?

BR
Sonnich

 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      09-12-2007
Scripsit Sonnich Jensen:

> I have code like this:


Do you have a URL?

> td { font-family: Verdana, Arial, Helvetica, sans-serif; color:
> #333333; text-decoration: none; font-size: 12px }
> .aa { font-family: Verdana, Arial, Helvetica, sans-serif; color:
> #990000; text-decoration: none; font-size: 12px; cursor: hand; }
> .aa:hover { font-family: Verdana, Arial, Helvetica, sans-serif; color:
> #000066; text-decoration: none; font-size: 12px; cursor: hand; }


That's not just pointlessly verbose. It also has several common symptoms of
misguided design. Please don't make me started.... I'll just mention ".aa"
(no hint about meaning), Verdana, 12px, and setting color without setting
background.

> problem: the css is a greater part of a project, so I cannot change
> all what I want in there.


Then the person responsible for the project as a whole should tell you how
to work within its general design. What _can_ you change? We have little
possibilities in helping you there, since we don't even know your page's
URL, still less anything about the project as a whole.

> The "aa" is my idea, it is for a clickable table, which works well -
> idea: the entire row should change from red to blue when clicked.


I don't believe you (I mean the part "works well"). Prove me wrong by
posting a URL.

> The problem is "color: #333333;" - once I remove that, it works as
> requested. So, how do I override that colour code up there?


You override a color set for a <td> by setting the color property for the
<td> in a style sheet rule that wins the rule you want to override, by the
CSS cascade mechanism.

> As I mentioned, I cannot remove it, so I have to override it somehow.


Set colors for <td> elements you want to color, not to <tr> elements
containing them. If there were no color setting to <td>, the element would
inherit the color value from its parent (<tr>), but you're telling me there
_is_ a setting and it cannot be removed.

Assuming that the clueless rule

td { font-family: Verdana, Arial, Helvetica, sans-serif; color:
#333333; text-decoration: none; font-size: 12px }

has been carved into stone by a clueless dee-ziner and sanctified by a
pointy-haired boss, so that they are beyond reasonable reconsideration for
now, you could just set

..aa td { color: #990000; cursor: hand; }
..aa:hover td { color: #000066; }

if you really want to do what you are doing. There's no point in repeating
the clueless font settings. (It would involve the risk of preserving those
bad settings for your "clickable rows" even if the overall style sheet of
the project were fixed.)

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
 
 
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      09-12-2007
Sonnich Jensen wrote:

> I have code like this:
>
> CSS:
> td { font-family: Verdana, Arial, Helvetica, sans-serif; color:
> #333333; text-decoration: none; font-size: 12px }


First, read this: http://k75s.home.att.net/fontsize.html

> .aa { font-family: Verdana, Arial, Helvetica, sans-serif; color:
> #990000; text-decoration: none; font-size: 12px; cursor: hand; }


You do not have to repeat font settings all the time. Just set it once
on the body. See above link.

> .aa:hover { font-family: Verdana, Arial, Helvetica, sans-serif; color:
> #000066; text-decoration: none; font-size: 12px; cursor: hand; }
>
> and html:
> <tr class='aa' ....
>
> problem: the css is a greater part of a project, ... <snip>
> Can anyone help me here?


Please post a test case and give the URL. There could be many factors
involved, not shown in your bit of code.

--
-bts
-Motorcycles defy gravity; cars just suck
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-12-2007
Sonnich Jensen wrote:

> The "aa" is my idea, it is for a clickable table, which works well -
> idea: the entire row should change from red to blue when clicked.



In addition to what the others have said, CSS is not programming
language so it really does not have events. If you want change as a
result of a "click" then your solution would require JavaScript. CSS
does have a pseudo-class that blurs the line here by trapping the mouse
hovers and focus events, but is limited to that and support is spotty.
MSIE only supports the :hover pseudo-class on links, A elements with the
HREF attribute. So it would not work on a table cell.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Sonnich Jensen
Guest
Posts: n/a
 
      09-12-2007
On Sep 12, 4:37 pm, "Jonathan N. Little" <(E-Mail Removed)>
wrote:
> Sonnich Jensen wrote:
> > The "aa" is my idea, it is for a clickable table, which works well -
> > idea: the entire row should change from red to blue when clicked.

>
> In addition to what the others have said, CSS is not programming
> language so it really does not have events. If you want change as a
> result of a "click" then your solution would require JavaScript. CSS
> does have a pseudo-class that blurs the line here by trapping the mouse


I found a solution which meets my need. By moving some stuff to <td> I
found a way. onmouse and onclick are placed in <td> and <tr> and that
does the trick.
Fortunately, I dont have any place to upload a demo.

BR
Sonnich

 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      09-12-2007
Sonnich Jensen wrote:

> Fortunately, I dont have any place to upload a demo.


Fortunately? Was that a typo? <lol>

--
-bts
-Motorcycles defy gravity; cars just suck
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-13-2007
Sonnich Jensen wrote:

> I found a solution which meets my need. By moving some stuff to <td> I
> found a way. onmouse and onclick are placed in <td> and <tr> and that
> does the trick.



onmouseover and onclick would be JavaScript.

> Fortunately, I dont have any place to upload a demo.
>


Don't say that, that is the lamest excuse over used in this NG. Everyone
has the ability to upload a dome somewhere...

1) on the free webspace provided by their ISP with their account
2) a temp folder on the existing website that they are futzing to find a
solution for
3) a free webserver... Google is your friend


Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      09-13-2007
In article <b0e29$46e88c96$40cba7b5$(E-Mail Removed)>,
"Jonathan N. Little" <(E-Mail Removed)> wrote:

> > Fortunately, I dont have any place to upload a demo.
> >

>
> Don't say that, that is the lamest excuse over used in this NG. Everyone
> has the ability to upload a dome somewhere...


What about if the person is being tied down in desert far from
any phone or cable or anything, surrounded by a moat and a ring
of fire and lions... no... this is too childish. I must not hit
the send button, I must not hit the send button, I must not hit
the send button, I must not hit the send button, I must not hit
the send button, I must not ...

--
dorayme
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-13-2007
dorayme wrote:
> In article <b0e29$46e88c96$40cba7b5$(E-Mail Removed)>,
> "Jonathan N. Little" <(E-Mail Removed)> wrote:
>
>>> Fortunately, I dont have any place to upload a demo.
>>>

>> Don't say that, that is the lamest excuse over used in this NG. Everyone
>> has the ability to upload a dome somewhere...

>
> What about if the person is being tied down in desert far from
> any phone or cable or anything, surrounded by a moat and a ring
> of fire and lions... no... this is too childish. I must not hit
> the send button, I must not hit the send button, I must not hit
> the send button, I must not hit the send button, I must not hit
> the send button, I must not ...
>


Then a CSS question is very low on their list of priorities

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Sonnich Jensen
Guest
Posts: n/a
 
      09-13-2007
On Sep 12, 8:48 pm, "Beauregard T. Shagnasty"
<(E-Mail Removed)> wrote:
> SonnichJensen wrote:
> > Fortunately, I dont have any place to upload a demo.

>
> Fortunately? Was that a typo? <lol>


You are absolutely right

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: correction: A question about css (was: A question about css) richard HTML 12 03-09-2010 08:52 PM
Is this the newsgroup for CSS help? CSS Question Included AF HTML 17 08-09-2006 06:57 PM
CSS question - can I make CSS Cascade sideways? Bill_W_Stephens@yahoo.com HTML 6 03-18-2006 06:02 PM
CSS Layout question - how to duplicate a table layout with CSS Eric ASP .Net 4 12-24-2004 04:54 PM
print.css and screen.css tom watson HTML 1 09-09-2003 02:48 PM



Advertisments