다음 HTML 코드에서 p 태그를 오른쪽 정렬로 만드는 방법
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <html xmlns= "http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" />
<title>无标题文档</title>
<style type= "text/css" >
#t1{ background-color:#f8f8f8;
border-bottom:1px solid #e6e6e6;
height:24px;
}
#t1 p{ width:900px;
margin:0px auto;
padding-top:5px;
float:right;
font-size:12px;
}
#t1 p a{text-decoration:none;color:#738197;}
</style>
</head>
<body>
<div id= "t1" ><p style= "color:#0CC" >
<a href= "http://pc.qq.com/" >苹果</a> ·
<a href= "http://www.qq.com/" >鸭梨</a> ·
<a href= "http://im.qq.com/" >鸡蛋</a> ·
<a href= "http://im.qq.com/mobileqq/" >白菜
</a>
</p>
</div>
</body>
</html>
|
로그인 후 복사
가운데 너비는 900px

1 2 3 4 5 6 7 8 | #t1 p{
width:900px;
margin:0px auto;
padding-top:5px;
font-size:12px;
overflow:hidden;
text-align:right;
}
|
로그인 후 복사
p 태그의 오른쪽 플로팅을 제거하고 텍스트 정렬을 오른쪽으로 변경 -정렬.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | <meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" >
<title>无标题文档</title>
<style type= "text/css" >
#t1{ background-color:#f8f8f8;
border-bottom:1px solid #e6e6e6;
height:24px;
}
#t1 p{ width:900px;
margin:0px auto;
padding-top:5px;
float:right;
font-size:12px;
}
#t1 p a{text-decoration:none;color:#738197;}
</style>
<div id= "t1" >
<p style= "color: rgb(0, 204, 204); text-align: right;" >
<a href= "http://pc.qq.com/" >苹果</a> ·
<a href= "http://www.qq.com/" >鸭梨</a> ·
<a href= "http://im.qq.com/" >鸡蛋</a> ·
<a href= "http://im.qq.com/mobileqq/" >白菜
</a>
</p>
</div>
|
로그인 후 복사
위 내용은 다음 HTML 코드에서 p 태그를 오른쪽 정렬하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!