user124
user124

Reputation: 493

Is it possible to align react Fragement?

I am having a react fragment which shows loader on user clicking button.The loader is shown until response comes.Everything works fine ,except that the fragment which has loader, should be aligned to a little right.As of now my fragment code to show loader(Using Wait from spectrum).

       <Fragment  >
        <Wait size="M" />
       Please wait....
      </Fragment>

How can I move fragment to right by some distance? I cannot use div as it disturbs the layout.I can though align Wait to center by using align property but it does not support any text on that.

Upvotes: 0

Views: 637

Answers (1)

bjrnt
bjrnt

Reputation: 2822

Fragments are not rendered in the final HTML so they cannot be selected by CSS. Therefore, you should use something which can be aligned, e.g. a div or other HTML element, and use CSS to create your desired layout.

If using a div disturbs your layout, I'd recommend revising the CSS of the containing object, if at all possible.

Upvotes: 2

Related Questions