EutMaster69
EutMaster69

Reputation: 13

Arranging 2 Div's Parallel

Problem :

Code :

<div style="overflow-y:scroll; width: 50%; height: 100vh; background-color: #ACDBC9;"> .... </div> <div style="overflow-y:scroll; width: 50%; height: 100vh; background-color: #ACDBC9;"> .... </div>

Tried Case :

Todo :

UPDATED FIDDLE : https://jsfiddle.net/genackwp/

THANKS

Upvotes: 1

Views: 500

Answers (3)

Abhishek Kumar
Abhishek Kumar

Reputation: 2539

Similar Helpful Stack Overflow Question
Just give your first div a class specifier to identify, and give it a float:left or just provide it in the inline style of that div.
Providing float:left to only first-div

div:first-child {
  float: left;
}
<div style=" overflow-y:scroll;width: calc(50% - 10px); height: 100vh; background-color: #ACDBC9;"> .... </div>
<div style="overflow-y:scroll; width: calc(50% - 10px);padding-left:10px; height: 100vh; background-color: #ACDBC9;"> .... </div>


Inline-style : float: left

<div style="float: left; overflow-y:scroll;width: calc(50% - 10px); height: 100vh; background-color: #ACDBC9;"> .... </div>
<div style="overflow-y:scroll; width: calc(50% - 10px);padding-left:10px; height: 100vh; background-color: #ACDBC9;"> .... </div>

Upvotes: 1

VSM
VSM

Reputation: 1785

<div style="overflow-y:scroll; width: 50%; height: 100vh; background-color: #ACDBC9; float:left; position:fixed;"> .... </div>
<div style="overflow-y:scroll; width: 50%; height: 100vh; background-color: #ACDBC9; float:left; position:fixed;"> .... </div>

https://jsfiddle.net/Sampath_Madhuranga/xpvt214o/605285/

Add position:fixed; to your code.

try this..It works fine now.

Upvotes: 1

YC1207
YC1207

Reputation: 54

<div style="overflow-y:scroll;position:fixed; width: 50%; height: 100vh; background-color: #ACDBC9;"><div>

try add "position:fixed;", see can work or not

Upvotes: 0

Related Questions