CSS - 位置绝对不同于Chrome / Opera到Firefox / IE

时间:2014-02-25 08:35:35

标签: css position

我是CSS的新手,并为此疯狂!请问,一些CSS专家可以告诉我为什么这个工具提示窗口显示在从Chrome / Opera到Firefox / IE的不同位置:http://jsfiddle.net/73F7w/1/

HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><body>
<div id="body_cont_actv">
  <form id="form" name="form" method="POST" action="pg.asp?d=active&s=2" accept-charset="utf-8" style="width:284px; margin-top:20px;">
    <div id="frmdv">
      <div class="newrow">
        <label for="user">
          <span class="requ">Username:</span>
          <input type="text" name="user" value="" maxlength="15" style="width:226px; text-transform:lowercase;">
        </label>
        <a href="#" class="tooltip">
          <img src="images/help.gif" class="help">
          <span>
            <strong>Username</strong><br>
            Allowed only small letters and numbers. Max 15 chars.
          </span>
        </a>
      </div>
      <div class="newrow">
        <label for="pswd">
          <span class="requ">Password:</span>
          <input type="password" name="pswd" value="" maxlength="15" style="width:102px; text-transform:lowercase;">
        </label>
        <label for="conf">
          <span class="requ">Check Password:</span>
          <input type="password" name="conf" value="" maxlength="15" style="width:102px; text-transform:lowercase;">
        </label>
       <a href="#" class="tooltip">
          <img src="images/help.gif" class="help">
          <span>
            <strong>Password</strong><br>
            Allowed only small letters and numbers. Max 15 chars.
          </span>
        </a>
      </div>
    </div>
    <div id="buttons">
      <input type="submit" name="send" value="Confirm">
      <input type="reset" name="clear" value="Clear">
    </div>
  </form>
  <script language="JavaScript">
    document.form.user.focus();
  </script>
</div>
</body>
</html>

CSS:

#form { padding:0; margin:0 auto; }
#form label { float:left; padding:0; margin:0 6px 0 6px; font-family:Arial, Helvetica, sans-serif; }
#form label span { display: block; margin-left:2px; font-size:12px; font-weight: bold; color:#5C5C5C; }
#form label span.requ { background-image:url(../images/required.png); background-repeat:no-repeat; background-position:right 5px; }
#form input { border:1px solid #939393; border-radius:6px; font-size:14px; background-color:#F8F8F8; }
#form input[type="text"] { padding:4px; color:#0067CE; }
#form input[type="password"] { padding:4px; color:#0067CE; }
#form input[type="checkbox"] { padding:0; margin-right:2px; position:relative; vertical-align:-2px; cursor:pointer; }
#form input[type="submit"] { width:100px; height:28px; padding:0; margin:0 5px 0 5px; font-size:15px; font-weight:bold; color:#FFFFFF; border: 1px solid #0062C4; border-radius:6px; background-color:#00A0DD; cursor:pointer; }
#form input[type="reset"]  { width:100px; height:28px; padding:0; margin:0 5px 0 5px; font-size:15px; font-weight:bold; color:#FFFFFF; border: 1px solid #707070; border-radius:6px; background-color:#9F9F9F; cursor:pointer; }
#form select { padding:3px; color:#0067CE; border:1px solid #939393; border-radius:6px; background-color:#F8F8F8; cursor:pointer; }
#form textarea { padding:4px; font:normal 14px Arial, Helvetica, sans-serif; color:#0067CE; border:1px solid #939393; border-radius:6px; background-color:#F8F8F8; }
#form .error { border:1px solid #FF2E13; }
#form .newrow { display:inline-block; margin:5px 0 5px 0; }
#form #reqmsg { clear:both; padding-top:16px; margin:0; font:normal 12px Arial, Helvetica, sans-serif; color:#5C5C5C; text-align:center; }
#form #buttons { padding:0; margin-top:22px; text-align:center; }

#body_cont_actv img.help { width:26px; height:26px; border:0px; margin-top:16px; margin-left:4px; }
#body_cont_actv a.tooltip { outline:none; font:normal 12px Arial, Helvetica, sans-serif; line-height:16px; text-align:justify; color:#5C5C5C; cursor:help; }
#body_cont_actv a.tooltip span { display:none; width:160px; padding:12px; margin-top:-44px; margin-left:284px; border:1px solid #DCA; border-radius:6px; background:#FFFAF0; }
#body_cont_actv a.tooltip:hover span { position:absolute; display:inline; }
#body_cont_actv a.tooltip strong { display:inline-block; margin-bottom:4px; }

谢谢!

1 个答案:

答案 0 :(得分:0)

尝试为mozilla搜索“moz”,为Chrome浏览器搜索“webkit”...

也许你可以制作一些截图?