[Google Style系列] 加框效果

Google的网页别具风格,简单,一眼就可以看出分类而又不失美观.我暂且称这个网页的风格为Google Style吧(自己觉得很合适),查看了它的源代码,研究了一番,希望以后借助这种风格来设计自己的网页.
 
Google Style No1: 加框效果
 
原处在 http://labs.google.cn/ 右边的”实验室毕业生”这个框.
 
思路:
实现上这是一个table,而且只有一行,一列.也就是一个tr,一个td.而在这个单元格中又是一个table,实现边框效果是利用两个table背景色的巧妙叠加,类似在同心圆的外层涂上颜色,
其中有两个不常用的参数解释一下:
 
cellspacing:
The cellspacing attribute controls the amount of space placed between adjacent cells in a table and along the outer edges of cells along the edges of a table.
单元格与表格外边缘以及单元格之间的空格数
 
 
cellpadding:
The cellpadding attribute controls the amount of space between the edge of a cell and its contents, which by default is 1 pixel.
单元格内部 单元格边缘与单元格内容之间的空格数,默认为1个像素
 
下面请看代码,为使效果明显,将边框改成了红色
< table  border ="0"  cellpadding ="0"  cellspacing ="1"  width ="100%"  align ="right"  bgcolor ="red" >   
    
<!--   bgcolor="red" 指定框架颜色  -->
    
<!--   cellspacing="1"  指定框架的粗细程度  -->
    
    
        
< tr >  
          
< td  bgcolor ="dae4fc" >  
              
< table  width ="100%"  cellpadding ="5"  cellspacing ="0"  bgcolor ="#ffffff" >  
                  
              
< tr >  
                
< td  colspan =3  nowrap >< b > 实验室毕业生 </ b ></ td >  
              
</ tr >
              
              
<!--                 
              1.        <td colspan="3">
                                            tells the browser to make the cell occupy the same horizontal space 
                                            as three cells in rows above or below it. 
                                            The browser flows the contents of the cell to occupy the entire space. 
                                
                            2.         nowrap:
                                    将单元格内容放在一个line上,除非使用<br>或<p>迫使其换行                    
                            
-->
               
              
< tr >
                
< td  valign ="top" >< img
                                        
src ="http://labs.google.com/images/yellow.gif"  width ="16"
                                        height
="16"  alt ="O" >
                            
</ td >  
                
< td >< font  size ="-1" >< a
                                        
href ="http://www.google.com/psearch/?hl=zh-CN" >< b > 个性化搜索 </ b ></ a >   < br >  
                  根据您的兴趣获得个性化的搜索结果
</ font >     
                  
<!--   size="-1" 实现了这个超链接有下划线的效果  -->
                 
</ td >  
              
</ tr >                                         
                    
</ table >                 
                
</ td >  
    
</ tr >  
</ table >
 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值