• 面试题目(1)


          来北京第二天,裸辞的我开始漫漫找工作的路。不过虽说依旧是菜鸟,但也还是感觉自己可以找到个好工作。面试第一家,那是一家外包公司,HR居然是女的,好严肃和犀利。气场上,我怂了。

         稍微问两三个问题,啊,没答上来,不耐烦的HR直接说了据——今天先到这儿。悲剧。不过俗话说,不打无准备的战,看,这就是下场,让我不看书。

         其中有一个问题是:ie6的一个bug——IE下两个div之间会出现3个像素的Bug(经典的3pxBug)。而后,自己试验了下这个问题,如何解决。

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css">
    * {margin:0;padding:0;border:none;}
    #content {500px;border:solid 1px #000;overflow:hidden;}
    #right{float:right;height:200px;background:#f60;opacity:0.5;100px;_margin-left:-3px;}
    #left {height:200px;background:#69c;margin-right:100px; _margin-right:-3px;}
    </style>
    </head>
    <body>
    <h2>两行左右分布,右侧固定左侧自适应。</h2>
    <div id="content"><div id="right">右侧的内容</div><div id="left">左侧的内容</div></div>
    </body>
    </html>

      解决方案:在left样式中加入_margin-right:-3px;在right样式中加入_margin-left:-3px;

      问题二,给一个div加阴影,兼容低版本的浏览器?我记得我当时的回答是,取阴影图片的一部分,repeat-x一下就ok了;或者直接加个背景颜色。而后一想,呀,我说的那不是加背景吗,傻了吧唧啊。

      要想兼容低版本,无非就是不使用css3,只能用css2。

      

    <!DOCTYPE HTML>
    <html>
    <head>
    <title>CSs阴影框,Div阴影</title>
    <style type="text/css">
    *{ margin:0; padding:0; border:0; }
    body{ padding:2em;}
    .box { 60%;background-color:#666}
    .box p {line-height:1.8; padding:2em; position:relative; top:-5px; left:-5px;background-color:#ccc}
    </style>
    </head>
    <body>
    <div class="box">
    <p>给div加个阴影试试</p>
    </div>
    </body>
    </html>

    主要原理,就是给文本套了个div,然后用相对定位挪下了点儿位置。

    第三个问题不太记得了,说是什么,给一个按钮,不断点击,数字不断增大,但是文本框不会被撑大??????????????

      

       

  • 相关阅读:
    并查集
    树状数组及二维树状数组
    maven工程编译成jar包
    The Salt Master has rejected this minion's public key!
    salt-minion dead but pid file exists 正确解决方法
    mysql 查找表的auto_increment和修改
    fastjson --JSONObject 和JSONArray 转换
    git 获取当前版本的commitid
    fastjson 使用笔记
    spring IOC 注解@Resource
  • 原文地址:https://www.cnblogs.com/wanliyuan/p/3621296.html
Copyright © 2020-2023  润新知