DIV里面的DIV 能够居中对齐不?

来源:百度知道 编辑:UC知道 时间:2024/06/18 11:13:41
就是把DIV中的那个DIV设置成居中对齐

能啊

说仔细点你要什么样的效果

<div style=" text-align:center"><div style="width:300px">sdfgsdfgsdfgsdfg</div></div>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>居中div</title>
<style type="text/css">
.center{
margin:0 auto; /* 居中 这个是必须的,,其它的属性非必须 */
}
</style>
</head>

<body>
<div cla