+ 3
How to put 2 divs next to each other using ONLY HYML
Hi SoloLearn. I am wondering how to put 2 divs next to each other using just HTML. I am doing challenge and it requires me to use just HTML not CSS(float:left;) Thank you! Have a great day! E.g: Zone 1 Zone 2 Zone 3 Footer
7 Answers
+ 7
Divs are block elements and normally without changing something, they canât go side by side. You can use float, position, or display, but they are all css options to change the behavior or position of the div.
Now using a table, and placing the divs in cells, thats not css. ;)
+ 2
Stefan Secrieru div are block level element and by default always start on a new line but there is a CSS trick that can make it possible set Zone3 position to flex and display to inline like this
<style>
.Zone3{
position:flex;
display :inline;
}
</style>
Using CSS column and row
+ 2
George S Mulbah Thank for your help!
+ 2
Stefan Secrieru I prepare a code on it try to read the code and understand how I did it you could copy it if you like because it just a tutorial for this issue
https://code.sololearn.com/WyZ7cZyR1XrF/?ref=app
https://code.sololearn.com/WyZ7cZyR1XrF/?ref=app
+ 1
Mike Thank you! I think that is it.
+ 1
George S Mulbah answers will put divs beside each other, but they still use css and the question specifically said âjust html not cssâ.
0
Thank you very much for your help!