6 Replies - 497 Views - Last Post: 02 December 2012 - 05:24 AM

#1 Groudon  Icon User is offline

  • New D.I.C Head

Reputation: -18
  • View blog
  • Posts: 33
  • Joined: 01-December 12

Basic td class

Posted 01 December 2012 - 09:30 PM

Can i can set this td class -
<html>
<body>
<title>Site Title</title>
<tr><td class="background-color:#00ff0; color:black; font-family:Vardana;"><a href="#">Home</a></td></tr><tr><td class="background-color:#00ff0; color:black; font-family:Vardana;"><a href="#">Login</a></td>
</body>
</html>


Is This A Good Question/Topic? 0
  • +

Replies To: Basic td class

#2 BetaWar  Icon User is online

  • #include "soul.h"
  • member icon

Reputation: 1147
  • View blog
  • Posts: 7,136
  • Joined: 07-September 06

Re: Basic td class

Posted 01 December 2012 - 09:32 PM

Class isn't the same thing as style. If you are using a class you need to define the class properties in CSS within the style tag. If you are doing inline styling you need to use the style attribute of the tag. For example:

<html>
<body>
<title>Site Title</title>
<tr><td style="background-color:#00ff0; color:black; font-family:Vardana;"><a href="#">Home</a></td></tr><tr><td style="background-color:#00ff0; color:black; font-family:Vardana;"><a href="#">Login</a></td>
</body>
</html>


Notice the style.

Hope that helps.
Was This Post Helpful? 0
  • +
  • -

#3 Groudon  Icon User is offline

  • New D.I.C Head

Reputation: -18
  • View blog
  • Posts: 33
  • Joined: 01-December 12

Re: Basic td class

Posted 01 December 2012 - 10:06 PM

body{background-color:blue; color:white; font-family:Vardana;}
td ul li{background-color:green; border:1px; color:black;}

example:
<html>
<body>
<title>Site Title</title>
<td>
<ul><li><a href="#">Index</li>
<ul><li><a href="#>Home</a></li>
<li><a href="#>Login</a></li></ul>
</ul>
</td>
</body>
</html>

Was This Post Helpful? 0
  • +
  • -

#4 chinchang  Icon User is offline

  • Indie Game Developer
  • member icon

Reputation: 192
  • View blog
  • Posts: 725
  • Joined: 22-December 08

Re: Basic td class

Posted 02 December 2012 - 03:00 AM

Your original styling was on TD and not on LI tag. So your selector will be:


td {background-color:green; border:1px; color:black;}


Was This Post Helpful? 0
  • +
  • -

#5 chinchang  Icon User is offline

  • Indie Game Developer
  • member icon

Reputation: 192
  • View blog
  • Posts: 725
  • Joined: 22-December 08

Re: Basic td class

Posted 02 December 2012 - 03:02 AM

Your original styling was on TD and not on LI tag. So your selector will be:


td {background-color:green; border:1px; color:black;}


Was This Post Helpful? 0
  • +
  • -

#6 Groudon  Icon User is offline

  • New D.I.C Head

Reputation: -18
  • View blog
  • Posts: 33
  • Joined: 01-December 12

Re: Basic td class

Posted 02 December 2012 - 04:33 AM

But i also use ul & li so ill use ul li in selector.
Was This Post Helpful? 0
  • +
  • -

#7 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3718
  • View blog
  • Posts: 5,989
  • Joined: 08-June 10

Re: Basic td class

Posted 02 December 2012 - 05:24 AM

td ul li { ... }
This only applies the block to <li> elements within <ul> elements within <td> elements, not all three. To do that, you'll have to separate the three with commas:
td, ul, li { ... }
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1