Subsequent declaration on TH and TD doesn't work

M

milanobybike

Ok.. now.. in my css file I declare the following:

#th { width:100px }
#th.h50 { width:50px }

Now.. when I go into the html code and put <th class="h50">, the
browsers just ignore that and leaves the width to 100px.. usually
declaring something later overwrites what's been declared earlier..
Does anyone know why it doesn't work in this case?

Thank you so much!
 
B

Benjamin Niemann

Hello,

Ok.. now.. in my css file I declare the following:

#th { width:100px }
#th.h50 { width:50px }

Replace this with

th { width:100px }
th.h50 { width:50px }

'#' is used to refer to elements by their ID.
Now.. when I go into the html code and put <th class="h50">, the
browsers just ignore that and leaves the width to 100px.. usually
declaring something later overwrites what's been declared earlier..
Does anyone know why it doesn't work in this case?

HTH
 
M

milanobybike

ops, sorry.. I left the # in but it's not there (I removed some parts
of the actual code not to clutter up my message with useless stuff)..

which means that the actual code is like the one you wrote.. and
doesn't work

(it was #nameofsection th)

thanx anyway!
 
J

Jukka K. Korpela

Scripsit (e-mail address removed):
ops, sorry..

Please learn to quote or paraphrase to give context for your reply.
I left the # in but it's not there (I removed some parts
of the actual code not to clutter up my message with useless stuff)..

Your problem description is pretty useless without a URL, and posting the
wrong code was just one indication of this.

Actually, the use of 100px and 50px suggests that the page should be
rewritten rather than polished a bit here and there.
 
M

milanobybike

Your problem description is pretty useless without a URL, and posting the
wrong code was just one indication of this.

After reading two replies, I understand that this is a problem that I
am having, which means that my code is not correct somewhere (otherwise
your replies would have been "Of course, with TD's and TH's you can't
do that!).. this is good enough a reply to me: I just wanted to know if
it's something that people is aware of or if it's my code's problem..
seems to be the latter..
Actually, the use of 100px and 50px suggests that the page should be
rewritten rather than polished a bit here and there.

Not quite.. I have a table containing data and I want one of the cells
to be 50px wide instead of 100px.

Oh, I forgot to write something very important: I'm in Italy and we all
know that here in Italy we're like 10 years behind the rest of the
world.. that's the reason why I HAVE TO use px instead of ems, % or
nothing at all.. one day we'll have the web like it's meant to be.. not
yet, though.. and it's a shame, but this is a different story..

Thank you very much!
 
J

Jonathan N. Little

Oh, I forgot to write something very important: I'm in Italy and we all
know that here in Italy we're like 10 years behind the rest of the
world.. that's the reason why I HAVE TO use px instead of ems, % or
nothing at all.. one day we'll have the web like it's meant to be.. not
yet, though.. and it's a shame, but this is a different story..

Now that explains it all! Way to say "I'm ignorant and damn proud of
it!" What a shame.
 
D

dorayme

(e-mail address removed) wrote:

(earlier:
Oh, I forgot to write something very important: I'm in Italy and we all
know that here in Italy...

)
ops, sorry..

It is "oops" not "ops", all tolerance for these things ran out
when Luigi left.
 
D

dorayme

It is "oops" not "ops", all tolerance for these things ran out
when Luigi left.

Dang, Martian, you are harsh! ;-)[/QUOTE]

I am unlikely to mellow until Luigi comes back. It strikes me
that we might still communicate with him via... a... a... luigi
board

Boom boom.
 
M

mbstevens

I am unlikely to mellow until Luigi comes back. It strikes me
that we might still communicate with him via... a... a... luigi
board

Boom boom.

Sounds like a left-floated and cleared ba-dump bump.
Zhat how one ba-dump bumps down under?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top