如何摆脱菜鸟界面(一)

最近这段时间一直在做一个项目的web界面,在这段期间,经历了心理和技术上的考验,而事实也证明我还只是一个“菜鸟”,但是通过这次经验,知道了菜鸟与大鸟的区别,今天就来跟大家一起分享一下,如何摆脱一看就能被戳穿的菜鸟界面。

 

   本文中所谓的菜鸟界面即我这些天的经历,通过多次被上司指正,多次的修改,最终界面才可以入眼。

 

   你是否也设计过类似下面的界面?

 

   菜鸟界面一:“杂乱无章”

   一个界面设计的好与坏,不仅仅是通过展现出来的界面来判定的,更是需要观看你是如何实现的,大鸟与菜鸟的区别就在于界面的背后是如何工作的。

 

   一个菜鸟的界面代码往往是杂乱无章,东拼西凑,毫无设计可言,偶尔有几个好的地方也说不出个所以然,问之,答曰:“摘自网络”。

 

   而对于大鸟们,我们可以通过它的代码看出他的设计思路,因为他们着重于设计,所以写出来的代码非常精简,看起来都会赏心悦目。

 

   菜鸟界面二:“照搬网络”

   作为一个编程人员,遇到问题谁都知道百度谷歌一下,但是同样是使用网络,那么菜鸟和大鸟的差别又体现在哪里呢?

 

   当一个菜鸟一遇到技术上的问题,就立刻上网搜集答案,恨不得有跟自己情景一模一样的答案(这个过程还是相当曲折的),然后照抄下来,在自己机器上一运行,不行?接着找……找啊找啊找啊找,实在不行,自己在基础上更改几个参数,最终运行成功?啊,谢天谢地,终于出来了!

 

   而大鸟们可不会这样,当他们遇到问题时,先静下心来进行分析,然后设计出自己的思路,进而将自己不懂的“点”通过网络来解决,最后思路走通,自己开始着手写代码,顺利实现自己所需功能。

 

   看出来区别了吗?菜鸟们把网络当“万能解决器”,而大鸟们只是拿它当“工具”,如何运用网络,需要我们自己去思考,或许你现在作为一个菜鸟,你的问题网上都可以解决,但当有一天,网上没有你所需要的东西的时候怎么办呢?

 

   菜鸟界面三:“推倒重来”

   由于菜鸟们不会设计,没有经验,考虑不周,导致到达后期一发现问题,就卷土重来,最后导致工期延误。

 

   而大鸟们则是提前把可能会发生的情况都进行了考虑,然后才设计自己的界面,最后菜鸟们遇到的问题早在大鸟这里规避掉了,提前完工,效率又高,面对这样的员工,有哪个老板不喜欢呢?

 

   上面说了菜鸟界面的三大表现,下面我们就来展示一下菜鸟跟大鸟的界面及代码:同样是制作一个表格显示数据的界面,一个使用table,一个使用div。

   菜鸟代码和界面:(使用table)

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
  2. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/basePage.dwt.jsp" codeOutsideHTMLIsLocked="false" -->  
  3. <head>  
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  5. <style>  
  6. #permission_main table {  
  7.     width:100%;  
  8. }  
  9.   
  10. #permission_main .rowShow {  
  11.     border-top:1px solid #CCCCCC;  
  12. }  
  13.   
  14. #permission_main .rowShow:hover  {  
  15.       
  16.     background:#DCEAC0 !important;  
  17.     cursor:pointer;  
  18. }  
  19.   
  20. #permission_main .colId {  
  21.         width:350px;  
  22. }  
  23. #permission_main .col {  
  24.     border-right:1px solid #ccc;  
  25.     border-bottom:1px solid #CCCCCC;  
  26.     height:35px;  
  27.     line-height:35px;  
  28. }  
  29. #permission_main .colF {  
  30.     width:60px;  
  31.     overflow: hidden;  
  32.     white-space: nowrap;  
  33. }  
  34.   
  35. #permission_main .colB {  
  36.     border-bottom:none;  
  37.     border-right:1px solid #CCCCCC;  
  38.     height:35px;  
  39.     line-height:35px;  
  40. }  
  41. #permission_main .colR {  
  42.     border-right:none;  
  43.     border-bottom:1px solid #CCCCCC;  
  44.     overflow: hidden;  
  45.     white-space: nowrap;  
  46. }  
  47.   
  48. #permission_main .title {  
  49.     font-weight:bold;  
  50. }  
  51. </style>  
  52. </head>  
  53. <body>  
  54. <table>  
  55.   <tr class="rowShow">  
  56.     <td  class="colF title col"><input name="rowNum000" type="checkbox" title="全选" id="ifAll" onClick="checkAll()"></td>  
  57.     <td class="title colId col" >角色id </td>  
  58.     <td class="title nowrap colR">角色名称 </td>  
  59.   </tr>  
  60.   <%  
  61.     for(int i=0;i<10;i++)  
  62.     {  
  63.   %>  
  64.       <tr class="rowShow"  >  
  65.         <td  class="colF col">  
  66.         <input type="checkbox"  class="checkbox1" value=""></td>  
  67.         <td class="colId col" >100<%=i+1%> </td>  
  68.         <td class="nowrap colR">赵丹丹<%=i+1%> </td>  
  69.       </tr>  
  70.   <%  
  71.     }  
  72.   %>  
  73.  <tr class="rowShow" >  
  74.     <td   class="colF colB"><input type="checkbox" class="checkbox1" value=""></td>  
  75.     <td class="colId colB" >1010 </td>  
  76.     <td class="nowrap">赵丹丹10 </td>  
  77.   </tr>  
  78. </table>  
  79. </body>  
  80. </html>  


 

   大鸟代码和界面:(使用div)

 

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
  2. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/basePage.dwt.jsp" codeOutsideHTMLIsLocked="false" -->  
  3. <head>  
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  5. <style>  
  6. * {  
  7.     margin:0;  
  8.     padding:0  
  9. }  
  10. body{  
  11.     height:100%;  
  12. }  
  13.   
  14. .table {  
  15.     float: left;  
  16.     width: 90%;  
  17.     min-width: 250px;  
  18.     max-height: 550px;  
  19.     margin: 10px auto auto 10px;  
  20.     text-align: center;  
  21.     background-color: #FFFFFF;  
  22. }  
  23.   
  24. .table .tr {  
  25.     height: 24px;  
  26.     border: 1px solid #B4B4B4;  
  27.     border-top: none;  
  28. }  
  29.   
  30. .table .th {  
  31.     height: 24px;  
  32.     background-color: #F2F2F2;  
  33.     border: 1px solid #B4B4B4;  
  34. }  
  35.   
  36. .table .td {  
  37.     padding: 5px 0px;  
  38.     float: left;  
  39. }  
  40.   
  41. .table .cchk{  
  42.     width: 24px;  
  43. }  
  44.   
  45. .table .cid {  
  46.     width: 50px;  
  47. }  
  48.   
  49. .table .cc {  
  50.     width: 70%;  
  51. }  
  52.   
  53. .table .tr:hover {  
  54.     /*  
  55.     background-color: #E7E4E1;  
  56.     */  
  57.     background-color: #FAFAD3;  
  58.     cursor: pointer;  
  59. }  
  60. </style>  
  61. <head>  
  62. </head>  
  63. <body>  
  64. <div id="table" class="table" oncontextmenu="return tr_rightclick()">  
  65.     <div class="th">  
  66.         <div class="td cchk">  
  67.             <input type="checkbox" onclick="checkAll(this)">  
  68.         </div>  
  69.         <div class="td cid">角色id</div>  
  70.         <div class="td cc">角色名称</div>  
  71.     </div>  
  72.   <%  
  73.     for(int i=0;i<10;i++)  
  74.     {  
  75.   %>  
  76.      <div class="tr" onclick="tr_click(i+1)">  
  77.         <div class="td cchk">  
  78.             <input type="checkbox" id="chk<%=i+1%>" onclick="tr_click(<%=i+1%>)">  
  79.         </div>  
  80.         <div class="td cid">100<%=i+1%></div>  
  81.         <div class="td cc">赵丹丹<%=i+1%></div>  
  82.     </div>  
  83.   <%  
  84.     }  
  85.   %>                   
  86. </div>  
  87. </body>  
  88. </html>  


 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值