24 replies [Last post]
arushi
Offline
newbie
Last seen: 14 years 44 weeks ago
Joined: 2005-11-17
Posts: 5
Points: 0

Hello,

This question might be stupid, but I need some help.

I have a css file with an entry for td as such:

td {
text-align: left;
vertical-align: top;
font-family:Verdana;
font-size:11px;
color:#6B6B6B;
line-height:12px;
}

This works great, the only problem is that I have a menu component in a tr that because the td applies this css messes up the menu in the way it appears.

So, here's the stupid question. How can I cancel the td style just for that specific tr, so that the style won't apply and the menu will work?

I want to keep the td style in my css file because all of my page is formatted using that, so I don't want to do away with it.

Any help will be greatly appreciated.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 36 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Stupid CSS Question

By the use of a class or ID or even careful descendent selector targeting.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

arushi
Offline
newbie
Last seen: 14 years 44 weeks ago
Joined: 2005-11-17
Posts: 5
Points: 0

Stupid CSS Question

That sounds good, but can you say that in english?

My level of knowledge in css is in the single digits, could you please help with an example.

Thanks

By the way, <span id=mymenu>menu here</span> doens't work, if that's what you mean.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 36 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Stupid CSS Question

Could do with seeing the code your working with really.

Can you not set a class or ID on the tr with the rules that it requires

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 6 years 29 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

Stupid CSS Question

That was English...

Anonymous
Anonymous's picture
Guru

Stupid CSS Question

wolfcry911 wrote:
That was English...

Location: London <---- Wink

Show your work! Smile

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 6 years 29 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

Stupid CSS Question

sorry - slacked off a bit there Cool

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 36 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Stupid CSS Question

Stop picking on me :mad:
here you go then,

Δεν μπορεί εσείς θέτει μια κατηγορία ή μια ταυτότητα στο TR με τους κανόνες που απαιτεί

As it clearly was Greek to you!

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

arushi
Offline
newbie
Last seen: 14 years 44 weeks ago
Joined: 2005-11-17
Posts: 5
Points: 0

Stupid CSS Question

Appart from all your cute little chatting sessions, could you please offer any real help to my question?

Thanks

n8gz4ez
n8gz4ez's picture
Offline
Leader
Last seen: 11 years 34 weeks ago
Timezone: GMT-6
Joined: 2005-06-13
Posts: 802
Points: 0

Stupid CSS Question

arushi wrote:
Appart from all your cute little chatting sessions, could you please offer any real help to my question?

Laughing out loud Now that is funny, this little chatting session started due to a lack of you providing the necessary code to solve your problem, :roll: and still no link for us?

This is my big chance . . . yep, I blew it . . .

arushi
Offline
newbie
Last seen: 14 years 44 weeks ago
Joined: 2005-11-17
Posts: 5
Points: 0

Stupid CSS Question

I did provide the code in my first post. I guess all the cute talk by some members distracted others...

There's not much more to show. A style is applied to all TD cells through a css file.

In one specific cell I have the need for "cancelling" the effects of the css style.

Can this be done, and how?

Thanks

Anonymous
Anonymous's picture
Guru

Stupid CSS Question

arushi wrote:
Appart from all your cute little chatting sessions, could you please offer any real help to my question?
With an attitude like that, highly unlikely. :twisted:

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 1 year 46 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Stupid CSS Question

Hi

css:

/* apply general page style for TD's */
td {background:blue}
/* apply code for ONE TD */
#my-own-td{background:red}
/* apply code to MANY TD's */
.my-own-tds{background:white}

html:

<table>
<tr>
<td>blah</td>
<td id="my-own-td">foo bar</td>
<td class="my-own-tds">foo bar1</td>
<td class="my-own-tds">foo bar2</td>
</tr>
</table>

OK

Shame on all you naughty chatty children Wink

Trevor

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 36 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Stupid CSS Question

Attitude does not get help and Trevor should not have really have provided that help until such time as you followed our request for sight of the code and the context it resided in, we did not ask it for fun!

Your snippet of code in the first post was out of context and had no relationship to anything.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Anonymous
Anonymous's picture
Guru

Stupid CSS Question

Ah ha! Who's the naughty one now? Wink Laughing out loud

arushi
Offline
newbie
Last seen: 14 years 44 weeks ago
Joined: 2005-11-17
Posts: 5
Points: 0

Stupid CSS Question

ClevaTreva,

Thanks a bunch. Your answer makes perfect sense.

For the rest, there was no attitude in my writing, I just needed some help, that's all. Chat away if you must, but there are better places to do that.

Anonymous
Anonymous's picture
Guru

Stupid CSS Question

arushi wrote:
Chat away if you must, but there are better places to do that.
Wow, thanks. Laughing out loud

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 1 year 46 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Stupid CSS Question

Hi

But I'm the sort of guy who takes pity on a stray, wet smelly dog even if it does pee on your carpet.

Call me soft. Cuddly, even. :roll:

Trevor

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 36 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Stupid CSS Question

Ok then you're soft, cuddly and even Smile

oops chatting away again *slapped wrist* apparently there are better places for that; there's nothing like being put in you place by a newbie Smile

So tell me arushi what part of 'classes' or 'ID's' didn't you understand that a written demonstration made apparently obvious sense to you?

If when I mentioned using classes why did that not suggest anything?

If you did not understand how a class is used how on earth did Trevors example make any sense.

If you had come back at me with a question along the lines of what's a class then I could have provided more answers, it is sometimes incumbent on the poster to interact, this forum is not about dishing up answers on a plate on demand.

Oh and if four senior members decide to have a little chat along the way that is our privilege and quite honestly is downright rude of you to suggest otherwise.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 1 year 46 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Stupid CSS Question

Hugo wrote:
Oh and if four senior members decide to have a little chat along the way that is our privilege and quite honestly is downright rude of you to suggest otherwise.

Tongue Tongue Tongue

And to think I was gonna go off for a pint.

Trevor

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 36 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Stupid CSS Question

Quote:
And to think I was gonna go off for a pint.

Think I'll join you Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 26 weeks 3 days ago
Joined: 2004-06-30
Posts: 9668
Points: 801

Stupid CSS Question

I think the OP has gone Evil

Verschwindende wrote:
  • CSS doesn't make pies

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 1 year 46 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Stupid CSS Question

Never liked OP.

Prefered Guiness mixed with Pernod. Seven of them and I was happy.

ct

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 36 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Stupid CSS Question

Shock Seven of those would make me happy as well; but under the table, comatose.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 1 year 46 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Stupid CSS Question

I remember severing an Achiles Tendon on the Pennine Way, found myself next to a pub in Aysgarth Falls after getting off the bus, had to walk a mile to the doctor. Floated all the way.