Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.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/7/css/38.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/powerbi/2.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
Html can';t put<;部门>;在没有其他元素向左浮动的新行上_Html_Css - Fatal编程技术网

Html can';t put<;部门>;在没有其他元素向左浮动的新行上

Html can';t put<;部门>;在没有其他元素向左浮动的新行上,html,css,Html,Css,我有一堆我正在设置为float:left。我希望我的div.title放在之后的新行上,而不存在与前面的相关的float-left属性。我该怎么做 这是小提琴: 这是我的密码: CSS: .center div ul{ 浮动:左; 宽度:245px; } .头衔{ 位置:相对位置; 宽度:100%; 左:0px; 顶部:140px; } HTML: 我的头衔有望左对齐 我使用了您的JSFIDLE并使其正常工作: .center-div { backgrou

我有一堆
我正在设置为
float:left
。我希望我的div
.title
放在
    之后的新行上,而不存在与前面的
      相关的float-left属性。我该怎么做

      这是小提琴:

      这是我的密码:

      CSS:

      .center div ul{
      浮动:左;
      宽度:245px;
      }
      .头衔{
      位置:相对位置;
      宽度:100%;
      左:0px;
      顶部:140px;
      } 
      HTML:
      
      
            我的头衔有望左对齐

                  我使用了您的JSFIDLE并使其正常工作:

                      .center-div {
                        background: #cfcfcf;
                        width: 100%;
                        margin-top: 40px;
                        display: block;
                      }
                  
                     .center-div {
                        overflow: hidden;
                        padding: 15px;
                      }
                  
                      .center-div ul {
                        float: left;
                        width: 245px;
                      }
                      .title{
                        clear: both;
                      }
                  
                  当您使用
                  清除时:两个你是说,我不想在我的html组件的左侧和右侧有任何内容

                      .center-div {
                        background: #cfcfcf;
                        width: 100%;
                        margin-top: 40px;
                        display: block;
                      }
                  
                     .center-div {
                        overflow: hidden;
                        padding: 15px;
                      }
                  
                      .center-div ul {
                        float: left;
                        width: 245px;
                      }
                      .title{
                        clear: both;
                      }