Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm learning react-bootstrap but I've found a pb . In fact, I'm making a responsive website and I want two designs with my form (for the sm screen and for the lg screen). I have a form with two selects . In sm mode, I want them to be one above the other (it already works) but in lg mode I want them to be side by side ... Any ideas? Thank u very much

JavaScript
<pre>import './searchBar.scss';
import {
  Form,
  Button,
} from 'react-bootstrap';

const AppHeader = () => (
  <div>
    <Form role="form" className=" ">
      <Form.Group>
        <Form.Label>Select Color : </Form.Label>
        <Form.Control as="select" custom>
          <option value="red">Red</option>
          <option value="blue">Blue</option>
          <option value="green">Green</option>
          <option value="black">Black</option>
          <option value="orange">Orange</option>
        </Form.Control>
        <Form.Label>Select Color : </Form.Label>
        <Form.Control as="select" custom>
          <option value="red">Red</option>
          <option value="blue">Blue</option>
          <option value="green">Green</option>
          <option value="black">Black</option>
          <option value="orange">Orange</option>
        </Form.Control>
      </Form.Group>
      <Button type="submit">Submit form</Button>
    </Form>
  </div>
);
export default AppHeader;



What I have tried:

I tried with display flex and display wrap but it doesn't works... 
Posted
Updated 26-Jul-23 19:08pm

1 solution

JavaScript

import './searchBar.scss';
import {
  Form,
  Button,
    } from 'react-bootstrap';
const AppHeader = () => (
  <div>
    <Form role="form" className=" ">
      <Form.Group>
        <Row>
          <Col lg={3} md={6} sm={12} xs={12}><pre lang="Javascript">

<form.label>Select Color :
<form.control as="select" custom="">
Red
Blue
Green
Black
Orange



<form.label>Select Color :
<form.control as="select" custom="">
Red
Blue
Green
Black
Orange




Submit form


);
export default AppHeader;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900