-8

I don't know the difference between "#" and "."to make a class. Example:

  .teste {
  color: red;
  }

  #teste {
   color: red;
  }
Litisqe Kumar
  • 2,512
  • 4
  • 26
  • 40

3 Answers3

3

# refers to the Id of an element, while . refers to a class. Read through https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/Selectors

Ayush
  • 41,754
  • 51
  • 164
  • 239
1

# refer to IDs of HTML elements. . refer to classes of HTML elements.

Given your example, the .teste will color the first div red, and the #teste will color the second div red.

<div class="teste"></div>
<div id="teste"></div>

See http://www.w3schools.com/CSSref/css_selectors.asp for more info.

Randell
  • 6,112
  • 6
  • 45
  • 70
1

'#' signifies a css 'id' whereas '.' is a css 'class'. Functionally they are the same, but conventionally you should only use an id once per page, and a class for multiple elements on the same page.

euwest
  • 31
  • 4