萧县王聪:dreamweaver中如何改变行距?

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 22:07:35
我用dreamweaverMX2004做网页时,发现自己打进去的字的行距非常大,请问怎么缩小行距?
我建的是JSP文档,然后插入了一个层,之后在这个层内打字发现行间距非常大,然而新建css好像只能改行高,就是每一行所占的高度,行间距似乎改不了.
请诸位赐教

一般有三种方式:
  1、采用margin-top属性,这样向上的间距为10px。如
  <p style=" margin-top:10px;">123456</p>
  <p style=" margin-top:10px;">123456</p>
  <p style=" margin-top:10px;">123456</p>

  2、采用margin-bottom属性,这样向下的间距为10px。如
  <p style=" margin-bottom:10px;">123456</p>
  <p style=" margin-bottom:10px;">123456</p>
  <p style=" margin-bottom:10px;">123456</p>

  3、使用line-height:20px;如
  <p style="line-height:10px;">123456</p>
  <p style=" line-height:10px;">123456</p>
  <p style=" line-height:10px;">123456</p>

方法1.在换行的时候: Shift+Enter
方法2.代码在行后加<br>

dreamweaver中改变行距的代码: line-height

没加原代码:

<title>无标题文档</title>
<style>
ul{ list-style:none;}
</style>
</head>

<body>
<ul>
    <li>百度知道百度知道百度知道百度知道</li>
    <li>百度知道百度知道百度知道百度知道</li>
</ul>
</body>


在 li{ line-height:50px;} 加了之后的加过

使用css的line-height属性,通过设置line-height可以改变p标签,a标签等行内元素的行距。

软件设置:改变字体 h字和体大小
代码:用属性ling-height设置字体行距

设置line-height:属性值

<div>测试<br>测试<br>测试<br></div>
<div style="line-height:10px">测试<br>测试<br>测试<br></div>
<div style="line-height:20px">测试<br>测试<br>测试<br></div>
<div style="line-height:30px">测试<br>测试<br>测试<br></div>
<div style="line-height:40px">测试<br>测试<br>测试<br></div>