css定位的问题,如何让图中蓝色元素保持在可视区域的最右侧

<head>
  <style>
    #app {
      position: relative;
      width: 400px;
      height: 400px;
      background-color: pink;
      overflow-x: scroll;
    }
    .dd {
      position: absolute;
      width: 1000px;
      height: 400px;
    }
    .asd {
      position: absolute;
      right: 0;
      left: auto;
      width: 50px;
      height: 400px;
      background-color: powderblue;
    }
  </style>
</head>
<body>
  <div id="app">
    <div class="dd"></div>
    <div class="asd"> </div>
  </div>
</body>

 

<head>
  <style>
    #app {
      position: relative;
      width: 400px;
      height: 400px;
      background-color: pink;
    }
    .aa {
      position: absolute;
      width: 100%;
      height: 100%;
      overflow-x: scroll;
    }
    .dd {
      position: absolute;
      width: 1000px;
      height: 400px;
    }
    .asd {
      position: absolute;
      top: 0;
      right: 0;
      width: 50px;
      height: 400px;
      background-color: powderblue;
    }
  </style>
</head>
<body>
  <div id="app">
    <div class="aa">
	    <div class="dd"></div>
    </div>
    <div class="asd"> </div>
  </div>
</body>

 

position:fixed;

right:0;