Aligning dialog on mobile












0















I have a dialog that pops up on a page load. It slides in from the top and then slides back up when it is closed. It works correctly on a desktop and displays as I want. But on a mobile device, the bottom of the dialog can be seen when it should be hidden. And when it shows on the page, it displays to far down the page so the user can't see the whole dialog.



I don't know how to set this up completely in jsfiddle to show the dialog but I have added my main code here. You can see the bottom of the dialog is showing but it shouldn't be. If the line in the media is removed the bottom doesn't show. If I could figure out how to show the dialog on the page, you would see that it displays too far down.



I hope this is enough for someone to help. Here's my code from jsfiddle.



    <style>
.login-announce-overlay{
background:transparent url(images/overlay.png) repeat top left;
position:fixed;
top:0px;
bottom:0px;
left:0px;
right:0px;
z-index:100;
}
.login-announce-box{
position:fixed;
top:-250px;
left:30%;
right:30%;
font-size:11px;
background-color:#fff;
color:#444;
padding:20px;
border:2px dashed #ff0000;
-moz-border-radius: 20px;
-webkit-border-radius:20px;
-khtml-border-radius:20px;
-moz-box-shadow: 0 1px 5px #333;
-webkit-box-shadow: 0 1px 5px #333;
z-index:101;
}
.login-announce-box h1{
border-bottom: 2px dashed #7F7F7F;
margin:-60px -20px 0px -20px;
padding:10px;
background-color:#00ff00;
color:#333;
-moz-border-radius:20px 20px 0px 0px;
-webkit-border-top-left-radius: 20px;
-webkit-border-top-right-radius: 20px;
-khtml-border-top-left-radius: 20px;
-khtml-border-top-right-radius: 20px;
}
a.login-announce-box-close{
float:right;
width:26px;
height:26px;
background:transparent url(images/cancel.png) repeat top left;
margin-top:-55px;
margin-right:-12px;
cursor:pointer;
}
.login-announce-box-heading {font-weight:bold;color:#ff0000; text-align:center;}
.login-announce-box-text {font-size:11px;color:#000;padding:4px;margin-bottom:4px;background:#fff;border:1px solid #9a9a9a;}
.login-announce-box-text A {font-weight:bold;color:#000;}
.login-announce-pop-text {font-size:20px;font-weight:bold;text-align:center}

.login-announce-counter-page,
.login-announce-counter-box {
color:red;
font-weight:bold;
border:1px solid gray;
background-color:#FFFF00;
font-size:14px;
text-align:center;
-moz-box-shadow: 0 1px 5px #333;
-webkit-box-shadow: 0 1px 5px #333;
}
.login-announce-counter-page {font-size:20px;}
@media (max-width: 640px) {
div.login-announce-box{ margin: 0 auto;width:90%;left:14px;top:-30px}
}
</style>

<div class="login-announce-overlay" id="login-announce-overlay" style="display:none;"></div>
<div class="login-announce-box" id="login-announce-box">
<a class="login-announce-box-close" id="login-announce-box-close"></a>
<h1>Title</h1>
<div>Message goes here</div>
<div style="padding:10px 0; text-align:center">A sub message goes here</div>
<div id="id-window"></div>
</div>









share|improve this question



























    0















    I have a dialog that pops up on a page load. It slides in from the top and then slides back up when it is closed. It works correctly on a desktop and displays as I want. But on a mobile device, the bottom of the dialog can be seen when it should be hidden. And when it shows on the page, it displays to far down the page so the user can't see the whole dialog.



    I don't know how to set this up completely in jsfiddle to show the dialog but I have added my main code here. You can see the bottom of the dialog is showing but it shouldn't be. If the line in the media is removed the bottom doesn't show. If I could figure out how to show the dialog on the page, you would see that it displays too far down.



    I hope this is enough for someone to help. Here's my code from jsfiddle.



        <style>
    .login-announce-overlay{
    background:transparent url(images/overlay.png) repeat top left;
    position:fixed;
    top:0px;
    bottom:0px;
    left:0px;
    right:0px;
    z-index:100;
    }
    .login-announce-box{
    position:fixed;
    top:-250px;
    left:30%;
    right:30%;
    font-size:11px;
    background-color:#fff;
    color:#444;
    padding:20px;
    border:2px dashed #ff0000;
    -moz-border-radius: 20px;
    -webkit-border-radius:20px;
    -khtml-border-radius:20px;
    -moz-box-shadow: 0 1px 5px #333;
    -webkit-box-shadow: 0 1px 5px #333;
    z-index:101;
    }
    .login-announce-box h1{
    border-bottom: 2px dashed #7F7F7F;
    margin:-60px -20px 0px -20px;
    padding:10px;
    background-color:#00ff00;
    color:#333;
    -moz-border-radius:20px 20px 0px 0px;
    -webkit-border-top-left-radius: 20px;
    -webkit-border-top-right-radius: 20px;
    -khtml-border-top-left-radius: 20px;
    -khtml-border-top-right-radius: 20px;
    }
    a.login-announce-box-close{
    float:right;
    width:26px;
    height:26px;
    background:transparent url(images/cancel.png) repeat top left;
    margin-top:-55px;
    margin-right:-12px;
    cursor:pointer;
    }
    .login-announce-box-heading {font-weight:bold;color:#ff0000; text-align:center;}
    .login-announce-box-text {font-size:11px;color:#000;padding:4px;margin-bottom:4px;background:#fff;border:1px solid #9a9a9a;}
    .login-announce-box-text A {font-weight:bold;color:#000;}
    .login-announce-pop-text {font-size:20px;font-weight:bold;text-align:center}

    .login-announce-counter-page,
    .login-announce-counter-box {
    color:red;
    font-weight:bold;
    border:1px solid gray;
    background-color:#FFFF00;
    font-size:14px;
    text-align:center;
    -moz-box-shadow: 0 1px 5px #333;
    -webkit-box-shadow: 0 1px 5px #333;
    }
    .login-announce-counter-page {font-size:20px;}
    @media (max-width: 640px) {
    div.login-announce-box{ margin: 0 auto;width:90%;left:14px;top:-30px}
    }
    </style>

    <div class="login-announce-overlay" id="login-announce-overlay" style="display:none;"></div>
    <div class="login-announce-box" id="login-announce-box">
    <a class="login-announce-box-close" id="login-announce-box-close"></a>
    <h1>Title</h1>
    <div>Message goes here</div>
    <div style="padding:10px 0; text-align:center">A sub message goes here</div>
    <div id="id-window"></div>
    </div>









    share|improve this question

























      0












      0








      0








      I have a dialog that pops up on a page load. It slides in from the top and then slides back up when it is closed. It works correctly on a desktop and displays as I want. But on a mobile device, the bottom of the dialog can be seen when it should be hidden. And when it shows on the page, it displays to far down the page so the user can't see the whole dialog.



      I don't know how to set this up completely in jsfiddle to show the dialog but I have added my main code here. You can see the bottom of the dialog is showing but it shouldn't be. If the line in the media is removed the bottom doesn't show. If I could figure out how to show the dialog on the page, you would see that it displays too far down.



      I hope this is enough for someone to help. Here's my code from jsfiddle.



          <style>
      .login-announce-overlay{
      background:transparent url(images/overlay.png) repeat top left;
      position:fixed;
      top:0px;
      bottom:0px;
      left:0px;
      right:0px;
      z-index:100;
      }
      .login-announce-box{
      position:fixed;
      top:-250px;
      left:30%;
      right:30%;
      font-size:11px;
      background-color:#fff;
      color:#444;
      padding:20px;
      border:2px dashed #ff0000;
      -moz-border-radius: 20px;
      -webkit-border-radius:20px;
      -khtml-border-radius:20px;
      -moz-box-shadow: 0 1px 5px #333;
      -webkit-box-shadow: 0 1px 5px #333;
      z-index:101;
      }
      .login-announce-box h1{
      border-bottom: 2px dashed #7F7F7F;
      margin:-60px -20px 0px -20px;
      padding:10px;
      background-color:#00ff00;
      color:#333;
      -moz-border-radius:20px 20px 0px 0px;
      -webkit-border-top-left-radius: 20px;
      -webkit-border-top-right-radius: 20px;
      -khtml-border-top-left-radius: 20px;
      -khtml-border-top-right-radius: 20px;
      }
      a.login-announce-box-close{
      float:right;
      width:26px;
      height:26px;
      background:transparent url(images/cancel.png) repeat top left;
      margin-top:-55px;
      margin-right:-12px;
      cursor:pointer;
      }
      .login-announce-box-heading {font-weight:bold;color:#ff0000; text-align:center;}
      .login-announce-box-text {font-size:11px;color:#000;padding:4px;margin-bottom:4px;background:#fff;border:1px solid #9a9a9a;}
      .login-announce-box-text A {font-weight:bold;color:#000;}
      .login-announce-pop-text {font-size:20px;font-weight:bold;text-align:center}

      .login-announce-counter-page,
      .login-announce-counter-box {
      color:red;
      font-weight:bold;
      border:1px solid gray;
      background-color:#FFFF00;
      font-size:14px;
      text-align:center;
      -moz-box-shadow: 0 1px 5px #333;
      -webkit-box-shadow: 0 1px 5px #333;
      }
      .login-announce-counter-page {font-size:20px;}
      @media (max-width: 640px) {
      div.login-announce-box{ margin: 0 auto;width:90%;left:14px;top:-30px}
      }
      </style>

      <div class="login-announce-overlay" id="login-announce-overlay" style="display:none;"></div>
      <div class="login-announce-box" id="login-announce-box">
      <a class="login-announce-box-close" id="login-announce-box-close"></a>
      <h1>Title</h1>
      <div>Message goes here</div>
      <div style="padding:10px 0; text-align:center">A sub message goes here</div>
      <div id="id-window"></div>
      </div>









      share|improve this question














      I have a dialog that pops up on a page load. It slides in from the top and then slides back up when it is closed. It works correctly on a desktop and displays as I want. But on a mobile device, the bottom of the dialog can be seen when it should be hidden. And when it shows on the page, it displays to far down the page so the user can't see the whole dialog.



      I don't know how to set this up completely in jsfiddle to show the dialog but I have added my main code here. You can see the bottom of the dialog is showing but it shouldn't be. If the line in the media is removed the bottom doesn't show. If I could figure out how to show the dialog on the page, you would see that it displays too far down.



      I hope this is enough for someone to help. Here's my code from jsfiddle.



          <style>
      .login-announce-overlay{
      background:transparent url(images/overlay.png) repeat top left;
      position:fixed;
      top:0px;
      bottom:0px;
      left:0px;
      right:0px;
      z-index:100;
      }
      .login-announce-box{
      position:fixed;
      top:-250px;
      left:30%;
      right:30%;
      font-size:11px;
      background-color:#fff;
      color:#444;
      padding:20px;
      border:2px dashed #ff0000;
      -moz-border-radius: 20px;
      -webkit-border-radius:20px;
      -khtml-border-radius:20px;
      -moz-box-shadow: 0 1px 5px #333;
      -webkit-box-shadow: 0 1px 5px #333;
      z-index:101;
      }
      .login-announce-box h1{
      border-bottom: 2px dashed #7F7F7F;
      margin:-60px -20px 0px -20px;
      padding:10px;
      background-color:#00ff00;
      color:#333;
      -moz-border-radius:20px 20px 0px 0px;
      -webkit-border-top-left-radius: 20px;
      -webkit-border-top-right-radius: 20px;
      -khtml-border-top-left-radius: 20px;
      -khtml-border-top-right-radius: 20px;
      }
      a.login-announce-box-close{
      float:right;
      width:26px;
      height:26px;
      background:transparent url(images/cancel.png) repeat top left;
      margin-top:-55px;
      margin-right:-12px;
      cursor:pointer;
      }
      .login-announce-box-heading {font-weight:bold;color:#ff0000; text-align:center;}
      .login-announce-box-text {font-size:11px;color:#000;padding:4px;margin-bottom:4px;background:#fff;border:1px solid #9a9a9a;}
      .login-announce-box-text A {font-weight:bold;color:#000;}
      .login-announce-pop-text {font-size:20px;font-weight:bold;text-align:center}

      .login-announce-counter-page,
      .login-announce-counter-box {
      color:red;
      font-weight:bold;
      border:1px solid gray;
      background-color:#FFFF00;
      font-size:14px;
      text-align:center;
      -moz-box-shadow: 0 1px 5px #333;
      -webkit-box-shadow: 0 1px 5px #333;
      }
      .login-announce-counter-page {font-size:20px;}
      @media (max-width: 640px) {
      div.login-announce-box{ margin: 0 auto;width:90%;left:14px;top:-30px}
      }
      </style>

      <div class="login-announce-overlay" id="login-announce-overlay" style="display:none;"></div>
      <div class="login-announce-box" id="login-announce-box">
      <a class="login-announce-box-close" id="login-announce-box-close"></a>
      <h1>Title</h1>
      <div>Message goes here</div>
      <div style="padding:10px 0; text-align:center">A sub message goes here</div>
      <div id="id-window"></div>
      </div>






      dialog position






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 19:33









      user3052443user3052443

      224211




      224211
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53461693%2faligning-dialog-on-mobile%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53461693%2faligning-dialog-on-mobile%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Costa Masnaga

          Fotorealismo

          Sidney Franklin