Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
::从CSS中选择会影响布局_Css - Fatal编程技术网

::从CSS中选择会影响布局

::从CSS中选择会影响布局,css,Css,更新: 我发现了这一点:保证金:0自动;在样式表的body{}块中,使标题移动。如果我删除它,横幅标题图片将移到右侧。那条线就是罪魁祸首。有人知道为什么吗 随着我的进步(在某种程度上是神秘的),这个问题变得相反了 我有这个头文件: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html

更新:

我发现了这一点:保证金:0自动;在样式表的body{}块中,使标题移动。如果我删除它,横幅标题图片将移到右侧。那条线就是罪魁祸首。有人知道为什么吗

随着我的进步(在某种程度上是神秘的),这个问题变得相反了

我有这个头文件:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head profile="http://gmpg.org/xfn/11">
        <link rel="stylesheet" href= "<?php echo base_url() ?>css/main_style.css" />        
        <link rel="stylesheet" href= "<?php echo base_url() ?>css/webform.css" />

    </head>
    <div id="header" class = "header"><h1 class="header">Real Estate Worldwide</h1> </div>

<body>


如果您看到的奇怪效果与没有适当的标记有关,我不会感到惊讶

编辑:当我发表评论时,我意识到这个问题对于OP来说可能不够清楚

您的HTML结构必须有效,首先:

<!DOCTYPE html >

<html>
    <head>
        <!-- title, meta, styles, etc go here -->
    </head>

    <body>
        <!-- all your other content goes here -->
    </body>
</html>

只是一个很快的提示:没有所谓的
float:center
。。。头文件中的
标记在哪里?如果你看到的奇怪效果与没有正确的标记有关,如果这不仅仅是你在问题中键入的代码中的错误,我不会感到惊讶。嗯,好的,我会删除它,但是,在上面的最新更新中,我指出了给我带来麻烦的那一行。你知道为什么吗?我复制并粘贴了,所以这里没有打字错误,嗯,所以..然后呢?我把尸体标签。。。再一次,您提供的代码中没有
标记。你的风格与主体挂钩,我不确定如果没有适当的标记,你会遇到什么其他浏览器怪癖,但是我会确保你在进一步调试CSS之前有有效的标记。我复制并粘贴了,所以这里没有输入错误,嗯,那么..然后呢?我把尸体标签。。。一秒钟后,我在标题中添加了标记。。但变化不大。我在所有其他代码之后添加了它,您使用的是SASS还是更少?您是否记得在生成页面页脚的任何文件中关闭
?您所说的“在所有其他代码之后”是什么意思?HTML页面的结构需要如下:
然后
然后(可选)
然后
->
以正确验证。
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home_c extends CI_Controller {



    function __construct()
    {

        parent::__construct();
        $this->load->model('home_model');


    }


    public function index ()

    {

        $this->load->view('header');
        $this->load->view('home');

    }




    public function load()


    {   $this->load->view('header');
        $data['paises'] = $this->home_model->devolverPaises();
        $data['ofertas'] = $this->home_model->devolverOfertas();
<!DOCTYPE html >

<html>
    <head>
        <!-- title, meta, styles, etc go here -->
    </head>

    <body>
        <!-- all your other content goes here -->
    </body>
</html>
#header {
    float:center; /* no such attribute... only left, right, none, or inherit */
    h2 {color:#ffffff;} /* you can't nest tags inside other specs, except with the use of pre-processors like SASS or LESS */
}