0

I used 2 different selectors to float an element expecting to get the same result, but i got different results. I don't know what is wrong. Here is my code:

/* I used this selector and floated it to the right */
 div > p{
 background-color: #A52A2A;
  float: right;



/* Then i used this selector, and i got a different result*/
#p1 {
  background-color: #A52A2A;
  float: right;


<div>
  <p id="p1"></p>
  <p id="p2"></p>
  <p id="p3"></p>
  <p id="p4"></p>
  [the first result][1]

the first result

0 Answers0