css定位一个标题

html-css015

css定位一个标题,第1张

<!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">

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />

<title>无标题文档</title>

<style>

<!--

.news1{

line-height: 26px

text-align: left

padding: 18px}

.news1 H1 {

FONT-WEIGHT: bold

FONT-SIZE: 14px

COLOR: #0000cc

LINE-HEIGHT: 34px

border-bottom-width: 2px

border-bottom-style: inset

border-bottom-color: #ddd

}

.news1 H1 span{

color: #999

font-size: 12px

font-weight: normal

}

.news1 H1 span.aa{

color: #ff0000font-size:14px

}

-->

</style>

</head>

<body>

<table><tr>

<td class="news1"><h1><span>08-05-29</span><span class="aa">文章来源</span>标题文字

</h1></td></tr></table>

</body>

</html>

方法1、标题和内容之间加一个换行 <br />

方法2、标题设置css行高 {line-height:100px}

方法3、内容设置css{margin-top:40px}

方法4、标题设置css {margin-bottom:40px}