2 replies [Last post]
guita3107
guita3107's picture
Offline
newbie
Last seen: 5 years 7 weeks ago
Timezone: GMT-2
Joined: 2014-11-26
Posts: 2
Points: 3

Hi all,

I'm experimenting with CSS and I'm confused about how it actually works. Example:

table td {
border: solid 1px #ccc;
}
.first_td {
border:dotted 1px #ccc;
}

The rule: all table cells with solid border, except the 1st cell with dotted border

Suppose it's a table with 5 rows, in each 1st TD cell of a row I use a class="first_td"

Result: all cells are solid bordered Sad

I'll thanks in advance for any tips ... Ken

gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 3 years 18 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

syntex error , i think

.first_td {
border:dotted 1px #ccc;
}

There is probably a syntext error in the css style that you've shown .

the rule is :

border: border-width border-style (required) border-color;

so what you got to do is :

border:dotted 1px #ccc;

and it should work .

guita3107
guita3107's picture
Offline
newbie
Last seen: 5 years 7 weeks ago
Timezone: GMT-2
Joined: 2014-11-26
Posts: 2
Points: 3

Actually found the issue ...

Actually found the issue ... hierarchy ... it should be:

table td { ... }

and then

table .first_td { ... }