css能否绘制树形关系图?_html/css_WEB-ITnose

php中文网
发布: 2016-06-24 12:12:45
原创
2342人浏览过

如题,效果如下


回复讨论(解决方案)

找美工做图片吧

要么做图片,打热点
可以 canvas,flash VML 来做, js动态生成很多点来画线,效率低。

写了个js生成点 画直线的,楼主参考下

<!DOCTYPE HTML><html>    <head>        <meta charset="gb2312" />        <title></title>        <style>            .point {                position:absolute;                width:1px; height:1px; overflow:hidden;                background:#000;            }            .col {                position:absolute; left:300px; top:100px;                font-size:20px; font-weight:bold; text-align:center;            }            .right {                left:500px;            }            p {                width:20px;                border:1px solid red;            }        </style>    </head>    <body>        <div class="col">            <p>a</p>            <p>c</p>            <p>b</p>        </div>        <div class="col right">            <p>B</p>
                    <div class="aritcle_card">
                        <a class="aritcle_card_img" href="/ai/2064">
                            <img src="https://img.php.cn/upload/ai_manual/000/000/000/175680148052964.png" alt="图像转图像AI">
                        </a>
                        <div class="aritcle_card_info">
                            <a href="/ai/2064">图像转图像AI</a>
                            <p>利用AI轻松变形、风格化和重绘任何图像</p>
                            <div class="">
                                <img src="/static/images/card_xiazai.png" alt="图像转图像AI">
                                <span>65</span>
                            </div>
                        </div>
                        <a href="/ai/2064" class="aritcle_card_btn">
                            <span>查看详情</span>
                            <img src="/static/images/cardxiayige-3.png" alt="图像转图像AI">
                        </a>
                    </div>
                <p><span>立即学习</span>“<a href="https://pan.quark.cn/s/cb6835dc7db1" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">前端免费学习笔记(深入)</a>”;</p>            <p>A</p>            <p>C</p>        </div>                <script>            var x = [];            var y = [];            document.onclick = function(e){                    e = window.event || e;                var tx = e.clientX;                var ty = e.clientY;                x.push(tx);                y.push(ty);                //console.log( x );                //console.log( y );                                if( x.length == 2 && y.length == 2 ){                    createLine(x[0], y[0], x[1], y[1]);                    x.length = 0;                    y.length = 0;                }                        }            function point(x, y){                var div = document.createElement('div');                div.style.left = x + 'px';                div.style.top = y + 'px';                div.className = 'point';                document.body.appendChild(div);            }                                    function createLine(x1,y1,x2,y2){                var tmp, x, y;                if(x1 >= x2){                    tmp = x1;                    x1 = x2;                    x2 = tmp;                    tmp = y1;                    y1 = y2;                    y2 = tmp;                        }                for(var i = x1 ; i < x2; i++){                    x = i;                    y = (y2 - y1)/(x2 - x1)*(x - x1)+y1;                    point(x,y);                }            }             </script>    </body></html>
登录后复制


?????,?主?考下:
?用鼠???名?展??????

nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



Organization

<script> <br /> function bluring(){ <br /> if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); <br /> } <br /> document.onfocusin=bluring; <br /> </script>



 

      

  •    

          

    •      

              

      •       

      •        

                  

        •         

        •        

              

      •       

      •          

                    

        •   

        •              

                          

          •       

          •               

          •              

                    

        •           

        •          

              

      •       

      •      

          

    •     

    •    

      

  •  



HTML速学教程(入门课程)
HTML速学教程(入门课程)

HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号