Subscribe:

Ads 468x60px

dropdown

Social Icons

CSS: Group Selectors - Learn CSS for free and fun ........



Group Selectors

What are Group Selectors?
 By using Group Selectors we can assign styling for a group of text at a time
 Group selectors contain a common set of property & values, which can be combined/grouped logically for easier coding.

How Group Selectors are used?

tag1,tag2 {Property:Value;}

tag1 {Property:changed value;}

tag2 {Property:changed value;}

Example
b,p {font-family:Arial, Helvetica, sans-serif; color:black; background:yellow;}
b {font-size:14px;}
p {font-size:10px;}

group selectors are used to define the common styles at once.
.headlines, .sublines, .infotext

 {
font-family:Arial, Helvetica, sans-serif; color:red; background:blue;
}
.headlines {font-size:14px;}
.sublines {font-size:12px;}
.infotext {font-size: 10px;}


With group selectors the typing time becomes less and editing becomes easy.

0 comments:

Post a Comment