Error when using CSS nth-child () [closed]

1
.citacao-bio {
    background-color: #D9E5E3;
    border: 10px solid #C2CCCA;
    width: 250px;
    box-sizing: border-box;
    margin: 20px 40px;
    float: left;
    position: relative;
}
.citacao-bio:nth-child(2){
    float: right;
}

<div class="citacao-bio">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec pulvinar dictum est, eget suscipit eros luctus blandit. Aliquam sodales nibh purus, vel aliquam nulla pretium et. Nunc pharetra tortor quis dolor viverra malesuada.
</div>

<div class="citacao-bio">
 Integer bibendum est felis, sit amet tempor elit posuere tincidunt. Cras tempus pharetra velit sed aliquet. Vivamus blandit magna commodo facilisis accumsan. Sed vitae pretium augue.
</div>

I'm trying to put the second item to the right of the content, but to no avail, and I can not find the error.

    
asked by anonymous 19.09.2016 / 14:56

2 answers

0

I managed, after a while, I had forgotten here in the stack, the correct syntax for the use is

EX:

:nth-child(1n){}
    
26.09.2016 / 03:05
0

Use the nth Tester from CSS Tricks. It will help you.

A good one for you to create Layouts would also be to use Flexbox . It already has good compatibility with the most modern browsers.

    
19.09.2016 / 15:22