Try this css:
.content {
display: flex;
justify-content: space-between;
}
This way, the two divs will have space in between and it should look good.
Try this css:
.content {
display: flex;
justify-content: space-between;
}
This way, the two divs will have space in between and it should look good.
While a flexbox approach works perfectly fine, I’d like to show how to achieve the described behaviour using float
.
Here’s the CSS
.float--left {
float: left
}
.float--right {
float: right
}
.clear {
clear: both;
}
And some HTML
<div class="float--left">name</div>
<div class="float--right">price</div>
<div class="clear">other content</div>
*Note: Added a example how to reset the float behaviour back to normal using clear *
<div className="content">
<div style={{ float: "left" }}> {pedido.nombre}</div> //name
<div style={{ float: "right" }}> ${pedido.precio}</div> //price
</div>
it should be name at left side and price on the right side, but it stays one side of the other
right there
stackblitz.com/edit/typescript-apbokz?file=index.html
So none of these worked for you?
Does this answer your question?
i don’t know how to, sorry, very noobie at this
@Drokoz take a look in
Did you remove “float: left” and “float: right”? Try this way.
Nop, i tried a lot of things, i also have an accordion that it doesn’t work. But is just in that part
It’s working now, i deleted a div above that. Thanks a lot!! i really appreciate it!