Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.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/3/html/76.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
Asp.net CSS导致xml位置不一致_Asp.net_Html_Css - Fatal编程技术网

Asp.net CSS导致xml位置不一致

Asp.net CSS导致xml位置不一致,asp.net,html,css,Asp.net,Html,Css,我认为我的样式表有问题。我的网站页面似乎设置得很好: 但是,当我在浏览器中查看它时,中间的文档不符合要求: 可能是什么原因导致了这一切?这让我想到我的css文件中的某些东西是什么?但是什么( 我的css文件如下所示: div.left { float: left; width: 15%; background-color: white; } div.right { float: right; width: 40%; background-

我认为我的样式表有问题。我的网站页面似乎设置得很好:

但是,当我在浏览器中查看它时,中间的文档不符合要求:

可能是什么原因导致了这一切?这让我想到我的css文件中的某些东西是什么?但是什么(

我的css文件如下所示:

    div.left
{
    float: left;
    width: 15%;
    background-color: white;
}

div.right
{
    float: right;
    width: 40%;
    background-color: white;
}

div.center
{
    float: left;
    width: auto;
    background-color: white;
    text-align:center;
}

这很可能是由于您的浮动元素,并且因为中心div根本没有浮动,而是被左div的
float:left
推到了中间

如果html中的
div
,如下所示:

<div class="parent_div">
    <div class="left"> left </div>

    <div class="center"> center</div>

    <div class="right"> right</div>
</div>

不客气。很高兴这是一个简单的解决方法:)。如果答案正是你想要的,请花点时间接受答案,这样以后其他有类似问题的人会更容易找到答案。我必须等待5分钟才能将其设置为答案;)当减少浏览器窗口大小时,它不是试图在屏幕上整合xml文档,而是将它们彼此堆叠在一起。这也是我的css的另一个问题吗?如果您没有父div,那么是的,因为这些项不适合新的窗口大小,因此这些项彼此位于下方。我将用一个父div编辑答案,您还应该添加一个所需宽度的父div。
div.center
{
    float: left;
    width: auto;
    background-color: white;
}