JavaScript Displaying React component on same line as other elements

I'm trying to get a React component I've built to display on the same line as the rest of the text, but it keeps appearing on a different line than the rest of the elements.

Here's my React code:

<div className={styles['top']}>
    <span>WHAT PEOPLE ARE SAYING</span>
    <div className={`pull-right ${styles['right']}`}>
      <span className={`${styles['rating-words']}`}>{ratingWords}</span>
      <Rating className={`${styles['overall-stars']}`}
              percentage={this.state.overallPercentage}
              color={"#00c18a"}
              under={"white"}
      />

    </div>
  </div>

and the .scss:

.top {
  margin: 30px 0;
  font-weight: bold;
  .right {
    display: inline-block;
    flex-direction: row;
  }
  .rating-words {
    text-transform: uppercase;
  }
}

and finally, a picture of what it looks like:

enter image description here

Both "VERY GOOD" and the rating stars should be on the same line. Any idea how to fix this?

Answer:1

If you have two child elements inside of .top this should work.

fiddle

.top {
  margin: 30px 0;
  font-weight: bold;
  display: flex;
  flex-direction: row;
  justify-content: space-between;

  .rating-words {
    text-transform: uppercase;
  }
  .right {
  }
}
Answer:2

For some reason I can't seem to find where by syntax error would be in this Lodash function. Does anyone know where I'm going wrong here? const classes = _.filter(state.classes, class => { ...

For some reason I can't seem to find where by syntax error would be in this Lodash function. Does anyone know where I'm going wrong here? const classes = _.filter(state.classes, class => { ...

  1. javascript lodash syntax

How can i recursively search a nested object to find the PATH to an object reference I'm providing? My original object looks like: a = { b: [ { children: [...more objects] }, { children: [] } ...

How can i recursively search a nested object to find the PATH to an object reference I'm providing? My original object looks like: a = { b: [ { children: [...more objects] }, { children: [] } ...

  1. javascript find path in tree
  2. javascript find path
  3. javascript find path to key
  4. javascript find path file
  5. javascript find shortest path
  6. javascript find root path
  7. javascript find current path
  8. javascript find relative path
  9. javascript find url path
  10. javascript find folder path
  11. javascript json find path
  12. javascript find full path
  13. javascript find base path
  14. javascript find element by path
  15. javascript find filename from path
  16. javascript find current file path
  17. javascript find object by path
  18. javascript tree find node path

I've a form in which i'm displaying values from my DB through WebApi. One of the control will be having array of values. i've a scenario where user can edit and save it(PUT function). Controller : ...

I've a form in which i'm displaying values from my DB through WebApi. One of the control will be having array of values. i've a scenario where user can edit and save it(PUT function). Controller : ...

I found the following code in Magento 2 HTML: <div id="cart-totals" class="cart-totals" data-bind="scope:'block-totals'"> Magento 2 uses Knockout on frontend but I cannot found in Knockout ...

I found the following code in Magento 2 HTML: <div id="cart-totals" class="cart-totals" data-bind="scope:'block-totals'"> Magento 2 uses Knockout on frontend but I cannot found in Knockout ...