Line two divs side by side with CSS and React
Solution to bring new Newsbox
component next to Coursebox
import Coursebox from './Coursebox';
import Newsbox from './Newsbox'
class ContainerRow extends React.Component {
render(){
return (
<div className='rowC'>
<Coursebox />
<Newsbox />
</div>
);
}
}
CSS
.rowC{display:flex; flex-direction:row;}
Here you go.
const ParentDiv = styled.div`
& {
width: 100%;
}
`;
const ChildDiv = styled.div`
& {
display: inline-block;
vertical-align: text-top;
margin: 0 auto;
}
`;