0

Hi all this is my css for div

 <style type="text/css">
    #container
    {
        width: 100%;
        padding-right: 200px;
    }

    #autowidth
    {
        width: 80%;
        float: right;
        z-index: 1;
        position: relative;
    }

    #fixed
    {
        width: 20%;
        position: fixed;
        z-index: 1;
        float: left;
        margin-right: -200px;
    }
</style>

and this is my design

 <div id="container">
 <div id="fixed">
 <table>
     // my controls
 </table>
 </div>
 <div id="autowidth">
 <table>
     // my controls
 </table>
 </div>
 </div>

But when I select some long text the 2 div's are overlapping enter image description here

Shaharyar
  • 12,254
  • 4
  • 46
  • 66
Developer
  • 8,390
  • 41
  • 129
  • 238

3 Answers3

1

Remove: margin-right: -200px;

or set margin-right :0.

NoobEditor
  • 15,563
  • 19
  • 81
  • 112
KumarA
  • 1,368
  • 3
  • 18
  • 41
1

just modified a bit your css remove position:fixed, and added display:table-cell/table where required hope it will help:

   #container {
       width: 100%;
       padding-right: 200px;
       display:table;
   }
   #autowidth {
       width: 80%;
       display:table-cell;
       z-index: 1;
       position: relative;

   }
   #fixed {
       width: 20%;
       z-index: 1;
       display:table-cell;
       margin-right: -200px;

   }

another solution could be to remove position:fixed and add box-sizing:border-box to left and right divs

#container {
    width: 100%;
    padding-right: 200px;
}
#autowidth {
    width: 80%;
    float: right;
    z-index: 1;
    position: relative;
    box-sizing:border-box;

}
#fixed {
    width: 20%;
    z-index: 1;
    float: left;
    margin-right: -200px;

    box-sizing:border-box;
}
vitaliy zadorozhnyy
  • 1,226
  • 10
  • 12
0

I think this can solve problem:

1.Try to set the width for the div which is being overlapped. (or) 2.Try Inline css.

I can help better if you share a screenshot.

Sri
  • 15
  • 3