+ -
当前位置:首页 → 问答吧 → H1标签布局问题

H1标签布局问题

时间:2011-07-27

来源:互联网

代码如下
HTML code

<div id="top"> 
   <p class="msg"> 
      <span><h1 id='indexh1'>您好,欢迎...</h1> 请登录  免费注册</span>
   </p> 
</div>



h1不能正常被p包含,会重新换一行,把p设display:inline高度又很大,设不小,把p改成span或div,高度又变得很小,12px左右,设不大。 css要怎么写好 哪位可以帮我调试一下

CSS code

#indexh1{
display:block;
font-size:12px;
line-height:23px;
display:inline;
}
#top .msg {
         display:block;
    line-height: 22px;
    height: 23px;
    background-image: url(../images/11.gif);
    background-repeat: repeat-x;
    text-align: right;
    color: #0099FF;
    margin: 0px;
    display:inline;
}


作者: hss229636011   发布时间: 2011-07-27

HTML code
<!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/html; charset=utf-8" />
<title>无标题文档</title>
<style>
*{margin:0; padding:0;}
#indexh1{
font-size:12px;
line-height:23px;
float:left;
}
#top .msg {
    background-image: url(../images/11.gif);
    background-repeat: repeat-x;
    text-align: right;
    color: #0099FF;
    margin: 0px;
    font-size:12px;
}
</style>
</head>

<body>
    <div id="top"> 
       <p class="msg"> 
          <h1 id='indexh1'>您好,欢迎...</h1> <span style="font-size:12px; line-height:23px;">请登录  免费注册</span>
       </p> 
    </div>

</body>
</html>



这个意思?

作者: MuBeiBei   发布时间: 2011-07-27