CSS Selectors

  • CSS class selectors defined with a period "."
  • CSS id selectors defined with a hash "#"
  • CSS selectors are defined as the HTML attribute.

CSS id Selector

  • The id selector is used to specify a style for a single, unique element.
  • The id selector uses the id attribute of the HTML element, and is defined using the hash symbol "#"
  • The style rule below will be applied to the element with id="area1"

#area1 {
width: 100%;
clear: both;
background-image: url(../images/sky-footer.png);
background-repeat: no-repeat;
height: 310px;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #C4C3BF;
}

CSS class Selector

  • The class selector can be used by multiple elements.
  • The class selector uses the class attribute of the HTML element, and is defined using the period symbol "."
  • The style rule below will be applied to the element with class="pesudo"

.pesudo {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
background-color: transparent;
width: 80%;
margin-left: auto;
color: #333;
font-size: 14px;
margin-right: auto;
margin-top: 60px;
text-align: center;
}

Google Ads

Connect with helpvid

you tubefollow our twitter tweets

Most Valuable Keywords Study

make money online