日期:2014-05-17  浏览次数:20414 次

php 的显示页面 最上边总有一行空白
代码
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/login.css" />
<title>无sdf</title>
</head>

<body>
<div class="container">
<div class="main">
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'login-form',
'enableClientValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
)); ?>
<div class="row">
<?php echo $form->labelEx($model,'用户名'); ?>
<?php echo $form->textField($model,'username'); ?>
<?php echo $form->error($model,'username'); ?>
</div>

<div class="row">
<?php echo $form->labelEx($model,'密码'); ?>
&nbsp;&nbsp;<?php echo $form->passwordField($model,'password'); ?>
<?php echo $form->error($model,'password'); ?>
</div>

<div class="row rememberMe">
<?php echo $form->checkBox($model,'rememberMe'); ?>
<?php echo $form->label($model,'记住我'); ?>
<?php echo $form->error($model,'rememberMe'); ?>
</div>

<div class="row buttons">
<?php echo CHtml::submitButton('登录'); ?>
<?php echo CHtml::submitButton('取消')  ?>
</div>

<?php $this->endWidget(); ?>
</div>
</div>
</div>
</body>
</html>


--css
body {
font-size:14px; 
margin: 0px;
font-family:"微软雅黑";
}

.container{
margin-top:0px;
width:100%;
background-color:#6633CC;
}

.main{
width:100%;
min-height:500px;
}

.form{
padding-top:250px;
padding-left:850px;
}


--firefox dug 下
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
?????               //错误在这里  这里竟然有空白
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<link href="/park/css/login.css" type="text/css" rel="stylesheet">
<title>无sdf</title>
<div class="container">
</body>
</html>
PHP

------解决方案--------------------
另存为utf-8 无bom格式
------解决方案--------------------
引用:
另存为utf-8 无bom格式
应该是这个原因,转换一下编码格式,一定用无BOM格式,我之前也遇到