• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Why do two different divs with 100% total width make one go down and not side by side?

Resolved: Why do two different divs with 100% total width make one go down and not side by side?

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Here’s what I’m trying to achieve.
And here’s the result I get.
Here’s the relevant html
and css
I’m trying to have the text show next to the picture, but it goes down. What am I missing?
Thank you for any help.

Answer:

In HTML, by default, everything goes from top to bottom. So in s2-r1, even though you have 2 children elements and they would fit side-by-side, they will go from top to bottom.
There are many ways to make them go from side to side, but the best approach heres is to add display: flex to the s2-r1 class. By the way, you wrote .section2-right img for the image selector where it should be .s2-r1 img.


If you have better answer, please add a comment about this, thank you!

css
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: In a Pinescript v5 Strategy why is my bool not working?

02/04/2023

Resolved: net::ERR_HTTP2_PROTOCOL_ERROR by http get request angular 15.2

02/04/2023

Resolved: How do I stop the command from happening if the requirements for it to work aren’t sert Discord.js

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.