Inheritance of properties using ID’s

When using an ID of a selector, always remember that the ID inherits the properties unless redefined in the selector.

So, if you have

td {

Background-image:url(image1.jpg);

Background-color:#000000;

}

td#one{

color:#444

}

That the “one” id will inherit the background-image and color from the td selector. Either those properties need to be redefined, or set to none, e.g.

Td#one {

Background-image:none;

Background-color:#ffffff;

color:#444;

}

Note:For a repeaint color hex code, writing it in this format#444 is shorthand to save code space if the digits keep on repeating.

Here are some similar arcade posts
Print This Post Print This Post

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)