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

夺命雷公狗-----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>

效果如下所示:

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

上一篇:Fireworks制作"曲别针照片"展示图效果


下一篇:CAD2012有时候安装成功有时候安装错误怎么办?