div border-radius

时间:2014-10-19 14:13:58   收藏:0   阅读:348

可以画个1/4之一的圆也可以画整个圆

 

<html>
<style type="text/css">
div{
    background-color: #000;
    width: 100px;
    height: 100px;
    border-radius: 50px;
    position: absolute;
}


#half{
    background-color: #fff;
    width: 50px;
    height: 50px;
    top: 1px;
    left: 1px;
    position: absolute;    
    border-radius: 50px 0 0 0 ;
}
</style>
<body>
    <div>
        <div id="half"></div>
    
    </div>
</body>
</html>

效果:

bubuko.com,布布扣

也可以画个半圆

<html>
<style type="text/css">
body{
    background-color: #f00;
}
div{
    content: "";
    position: relative;
    left: 200px;
    width: 200px;
    height: 400px;    
    border-radius: 0px 200px 200px 0px;
    background-color: #fff;
    display: block;
}
</style>
<body>
    <div></div>
</body>
</html>

说明:后者将替换前者,很正常,健值只能有一个。但如果使用的是array_merge_recursive()则可保留,并作一个子数组存在。如:

<?php
 header(‘Content-type: text/html; charset=utf8‘);
 $book1 = array(‘linux‘=>‘linux服务器配置与管理‘,‘php‘=>‘PHP程序设计‘);
 $book2 = array(‘linux‘=>‘服务器配置与管理‘,‘jsp‘=>‘PHP‘); 
    
 $result = array_merge_recursive($book1,$book2);

 print_r($result);
 //Array ( [linux] => Array ( [0] => linux服务器配置与管理 [1] => 服务器配置与管理 ) [php] => PHP程序设计 [jsp] => PHP )
?>

 

 

2、如果这两个数组中有相同的数值键名:

<?php
 header(‘Content-type: text/html; charset=utf8‘);

 $book1 = array(‘linux服务器配置与管理‘,‘PHP程序设计‘);
 $book2 = array(‘服务器配置与管理‘,‘PHP‘); 
  
 $result = array_merge($book1,$book2);
 print_r($result);
 //Array ( [0] => linux服务器配置与管理 [1] => PHP程序设计 [2] => 服务器配置与管理 [3] => PHP )
?>

 

这时,如果数组中包含相同的数字键名,则后面的不会覆盖前面的值,而是后面的键值按顺序依次增加,附在后边。

 

原文:http://www.cnblogs.com/ghgyj/p/4034835.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!