• 夺命雷公狗-----React---12--添加类和样式


    <!DOCTYPE>
    <html>
        <head>
            <meta charset="utf-8">
            <title></title>
            <script src="./js/react.js"></script>
            <script src="./js/react-dom.js"></script>
            <script src="./js/browser.min.js"></script>
            <style>
                *{ margin:0px;  padding:0px;}
                .list ul{ list-style:none; }
                .content{ margin:10px 0px 0px 30px; float:left; border:1px solid red; line-height:80px; border-radius:20px; }
                .content a{ font-size:20px; text-decoration:none; }
    
            </style>
        </head>
        <body>
            <div id="dome"></div>
            <script type="text/babel">
                var Fir = React.createClass({
                    render:function(){
                        return (
                            <div id="list">
                                <ul>
                                    <li style={{'clear':'both'}}>
                                        <div style={{'float':'left'}}>
                                            <img src={this.props.scc} style={{'width':'100px'}} />
                                        </div>
                                        <div style={{'float':'left','marginLeft':'10px'}}>
                                            <p style={ {'color':'red','fontSize':'50px'}}>Name: {this.props.user}</p>
                                            <p>
                                                <span>AGE:{this.props.age}</span> 
                                            </p>
                                        </div>    
                                        <div className="content" ><a href={this.props.url}>个人详情</a></div>
                                    </li>
                                </ul>
                                <div style={{'clear':'both'}}></div>
                                <form action="" method="" style={{'marginTop':'10px','marginLeft':'15px'}}>
                                    <textarea cols="50" rows="10"></textarea>
                                </form>
                            </div>
                        );
                    }
                });
    
                //con.style.border="1px solid red";
                var obj = {
                    user : '夺命雷公狗',
                    age : '16',
                    scc : './images/jj.png',
                    url : 'http://www.showtp.com'
                }
    
                ReactDOM.render(
                    <Fir {...obj} />,
                    document.getElementById('dome')
                );
            </script>
        </body>
    </html>

    效果如下所示:

  • 相关阅读:
    SQL语句中的左连接、右连接、内连接的理解心得
    MySQL+Java使用心得(1)
    【转】国内常见WEB安全扫描产品概述
    [C puzzle book] operators
    【Python】Symbol Review
    A function for new storage space of string
    【SRX】折腾了半天终于我的那对SRX210 升级到了 12.1R1.9
    [C puzzle book] Control Flow
    [C puzzle book] types
    荷兰TAC的需求
  • 原文地址:https://www.cnblogs.com/leigood/p/6072299.html
Copyright © 2020-2023  润新知