Css 创造;“列”;DIV内部:如何放置它们?

Css 创造;“列”;DIV内部:如何放置它们?,css,html,Css,Html,这是: 在“OqueFazemos”部分,我需要创建两个“列”,左侧显示文本,右侧显示图像。我应该如何正确放置图像 另外,在另一节中,我需要创建三个“列”。我遵循同样的规则吗 请记住,我希望文本在左侧对齐,图像在右侧对齐 非常感谢 HTML 您可能希望查看div的行为以及css float的工作方式: 尝试添加float:left;到您的第二个内容分区,即: .o-que-fazemos-content-2 { margin-right:10%; width: 50%;

这是:

在“OqueFazemos”部分,我需要创建两个“列”,左侧显示文本,右侧显示图像。我应该如何正确放置图像

另外,在另一节中,我需要创建三个“列”。我遵循同样的规则吗

请记住,我希望文本在左侧对齐,图像在右侧对齐

非常感谢

HTML


您可能希望查看div的行为以及css float的工作方式:

尝试添加float:left;到您的第二个内容分区,即:

.o-que-fazemos-content-2 {  
    margin-right:10%;
    width: 50%;
    float: left;
    text-align: right;
}

编辑:而且,正如Josh所指出的,您可能还需要清除浮动,即在.o-que-fazemos上添加溢出:隐藏或使用清除修复程序,您可能希望查看div的行为和css浮动的工作方式:

尝试添加float:left;到您的第二个内容分区,即:

.o-que-fazemos-content-2 {  
    margin-right:10%;
    width: 50%;
    float: left;
    text-align: right;
}

编辑:而且,正如Josh所指出的,您可能还需要清除浮动,即在.o-que-fazemos上添加溢出:隐藏或使用清除修复程序,您可能希望查看div的行为和css浮动的工作方式:

尝试添加float:left;到您的第二个内容分区,即:

.o-que-fazemos-content-2 {  
    margin-right:10%;
    width: 50%;
    float: left;
    text-align: right;
}

编辑:而且,正如Josh所指出的,您可能还需要清除浮动,即在.o-que-fazemos上添加溢出:隐藏或使用清除修复程序,您可能希望查看div的行为和css浮动的工作方式:

尝试添加float:left;到您的第二个内容分区,即:

.o-que-fazemos-content-2 {  
    margin-right:10%;
    width: 50%;
    float: left;
    text-align: right;
}

编辑:而且,正如Josh指出的,您可能还需要清除浮动,即在.o-que-fazemos上添加溢出:隐藏或使用清除修复程序,您可以尝试添加溢出:隐藏至:

.o-que-fazemos {
background-image: url('images/oqfazemosFUNDO.png');
font-family: 'Source Sans Pro', sans-serif;
background-repeat: repeat-x repeat-y;
height:auto;
font-size:28px;
padding: 50px;
}

如果这不起作用,试着在o-que-fazemos-content-1和2周围放一个div,并将溢出:隐藏;而不是在那里

您可以尝试添加溢出:隐藏至:

.o-que-fazemos {
background-image: url('images/oqfazemosFUNDO.png');
font-family: 'Source Sans Pro', sans-serif;
background-repeat: repeat-x repeat-y;
height:auto;
font-size:28px;
padding: 50px;
}

如果这不起作用,试着在o-que-fazemos-content-1和2周围放一个div,并将溢出:隐藏;而不是在那里

您可以尝试添加溢出:隐藏至:

.o-que-fazemos {
background-image: url('images/oqfazemosFUNDO.png');
font-family: 'Source Sans Pro', sans-serif;
background-repeat: repeat-x repeat-y;
height:auto;
font-size:28px;
padding: 50px;
}

如果这不起作用,试着在o-que-fazemos-content-1和2周围放一个div,并将溢出:隐藏;而不是在那里

您可以尝试添加溢出:隐藏至:

.o-que-fazemos {
background-image: url('images/oqfazemosFUNDO.png');
font-family: 'Source Sans Pro', sans-serif;
background-repeat: repeat-x repeat-y;
height:auto;
font-size:28px;
padding: 50px;
}

如果这不起作用,试着在o-que-fazemos-content-1和2周围放一个div,并将溢出:隐藏;而不是在那里

将您的部分做成网格,以便更轻松地对齐列。例如

.o-que-fazemos {
**postion: relative;**
**display: block;**
**float: left;**
overflow: hidden; *ie7 bug fix*
}

.o-que-fazemos-content-1, .o-que-fazemos-content-2 {
 display: block;
 float: left;
 }

.o-que-fazemos-content-1  {
text-align: left;
}

.o-que-fazemos-content-2 {
text-align: right;
}
对其他列采用相同的方法。 任何东西都需要保持浮子,否则它就无法保持其高度

在这个主题上,一个单独的列表有一篇很好的文章。

将您的部分做成网格,以便更轻松地对齐列。例如

.o-que-fazemos {
**postion: relative;**
**display: block;**
**float: left;**
overflow: hidden; *ie7 bug fix*
}

.o-que-fazemos-content-1, .o-que-fazemos-content-2 {
 display: block;
 float: left;
 }

.o-que-fazemos-content-1  {
text-align: left;
}

.o-que-fazemos-content-2 {
text-align: right;
}
对其他列采用相同的方法。 任何东西都需要保持浮子,否则它就无法保持其高度

在这个主题上,一个单独的列表有一篇很好的文章。

将您的部分做成网格,以便更轻松地对齐列。例如

.o-que-fazemos {
**postion: relative;**
**display: block;**
**float: left;**
overflow: hidden; *ie7 bug fix*
}

.o-que-fazemos-content-1, .o-que-fazemos-content-2 {
 display: block;
 float: left;
 }

.o-que-fazemos-content-1  {
text-align: left;
}

.o-que-fazemos-content-2 {
text-align: right;
}
对其他列采用相同的方法。 任何东西都需要保持浮子,否则它就无法保持其高度

在这个主题上,一个单独的列表有一篇很好的文章。

将您的部分做成网格,以便更轻松地对齐列。例如

.o-que-fazemos {
**postion: relative;**
**display: block;**
**float: left;**
overflow: hidden; *ie7 bug fix*
}

.o-que-fazemos-content-1, .o-que-fazemos-content-2 {
 display: block;
 float: left;
 }

.o-que-fazemos-content-1  {
text-align: left;
}

.o-que-fazemos-content-2 {
text-align: right;
}
对其他列采用相同的方法。 任何东西都需要保持浮子,否则它就无法保持其高度

在这个主题上,一个单独的列表有一篇很好的文章。

/*CSS文档*/

html,body {
    height:100%;    
    margin:0;
    padding:0;
    border:0;
    }

div {
    margin:0;
    border:0;
    }

.login {
  display: table-cell;
}

logo {  
    border:0;
    z-index:9999;
    float:left;

    }

.menu-fundo {
    background: #fff repeat-x 0 0;
    left: 0;
    top: 0;
    z-index: 9999;
    position:fixed;
    }

.f-menu {
    z-index: 9999;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    } /* isso vai fazer o menu ficar fixo no topo */

.menu {
height: 100px;
left: 0;
top: 0;
z-index: 9999;
background: #fff repeat-x 0 0;
position:fixed; width:100%
}

.menu ul {
    list-style: none;
    font-family: 'Source Sans Pro', sans-serif;
    font-size:17px;
    font-weight:bold;
    position: fixed;
    top: 0;
    right: 0;
    display: table-cell;
    vertical-align: middle;
    width: 100%;
    }

.menu ul li {
float: right;
padding-right:30px;
padding-top:0px;
}

.menu ul li:first-child {
    padding-left: 0;
    }

.menu ul li a {
    color:#000;
    text-decoration:none;
    border-top:3px solid #999;
    }

.menu ul li a:hover {
    color: #6D6D6D;
    border-top:3px solid #EA0000;
    }
/*your grid*/
.row, .o-que-fazemos, .como-fazemos, .quem-somos {
display: block;
float: left;
postiion: relative;
overflowhidden;
}

.o-que-fazemos {
    background-image: url('images/oqfazemosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;

}
.o-que-fazemos-content-1, .o-que-fazemos-content-2 {
 display: block;
 float: left;
 }

.o-que-fazemos-title {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#ffc709;
    font-weight:900;
    letter-spacing: 2px;
    }

.o-que-fazemos-subtitle {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#FFF;
    font-weight:900;
    letter-spacing: 2px;
    }
.o-que-fazemos-content-1 {  
    font-family: 'Source Sans Pro', sans-serif;
    font-size:20px;
    color:#FFF;
    text-align: left;
    }


.o-que-fazemos-content-2 {  

    text-align: right;
    }

.como-fazemos {
    background-image: url('images/comofazemosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    padding: 50px;
    }

.como-fazemos-title {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#FFF;
    font-weight:900;
    letter-spacing: 2px;
    }

.quem-somos {
    background-image: url('images/quemsomosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.a-equipe {
    background-image: url('images/EQUIPE-FUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.o-contato {
    background-image: url('images/contato-FUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.banner {
    position: relative;
    overflow: auto;
    }

.banner li {
    list-style: none;
    }

.banner ul li {
    float: left;
    }
/*CSS文档*/

html,body {
    height:100%;    
    margin:0;
    padding:0;
    border:0;
    }

div {
    margin:0;
    border:0;
    }

.login {
  display: table-cell;
}

logo {  
    border:0;
    z-index:9999;
    float:left;

    }

.menu-fundo {
    background: #fff repeat-x 0 0;
    left: 0;
    top: 0;
    z-index: 9999;
    position:fixed;
    }

.f-menu {
    z-index: 9999;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    } /* isso vai fazer o menu ficar fixo no topo */

.menu {
height: 100px;
left: 0;
top: 0;
z-index: 9999;
background: #fff repeat-x 0 0;
position:fixed; width:100%
}

.menu ul {
    list-style: none;
    font-family: 'Source Sans Pro', sans-serif;
    font-size:17px;
    font-weight:bold;
    position: fixed;
    top: 0;
    right: 0;
    display: table-cell;
    vertical-align: middle;
    width: 100%;
    }

.menu ul li {
float: right;
padding-right:30px;
padding-top:0px;
}

.menu ul li:first-child {
    padding-left: 0;
    }

.menu ul li a {
    color:#000;
    text-decoration:none;
    border-top:3px solid #999;
    }

.menu ul li a:hover {
    color: #6D6D6D;
    border-top:3px solid #EA0000;
    }
/*your grid*/
.row, .o-que-fazemos, .como-fazemos, .quem-somos {
display: block;
float: left;
postiion: relative;
overflowhidden;
}

.o-que-fazemos {
    background-image: url('images/oqfazemosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;

}
.o-que-fazemos-content-1, .o-que-fazemos-content-2 {
 display: block;
 float: left;
 }

.o-que-fazemos-title {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#ffc709;
    font-weight:900;
    letter-spacing: 2px;
    }

.o-que-fazemos-subtitle {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#FFF;
    font-weight:900;
    letter-spacing: 2px;
    }
.o-que-fazemos-content-1 {  
    font-family: 'Source Sans Pro', sans-serif;
    font-size:20px;
    color:#FFF;
    text-align: left;
    }


.o-que-fazemos-content-2 {  

    text-align: right;
    }

.como-fazemos {
    background-image: url('images/comofazemosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    padding: 50px;
    }

.como-fazemos-title {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#FFF;
    font-weight:900;
    letter-spacing: 2px;
    }

.quem-somos {
    background-image: url('images/quemsomosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.a-equipe {
    background-image: url('images/EQUIPE-FUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.o-contato {
    background-image: url('images/contato-FUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.banner {
    position: relative;
    overflow: auto;
    }

.banner li {
    list-style: none;
    }

.banner ul li {
    float: left;
    }
/*CSS文档*/

html,body {
    height:100%;    
    margin:0;
    padding:0;
    border:0;
    }

div {
    margin:0;
    border:0;
    }

.login {
  display: table-cell;
}

logo {  
    border:0;
    z-index:9999;
    float:left;

    }

.menu-fundo {
    background: #fff repeat-x 0 0;
    left: 0;
    top: 0;
    z-index: 9999;
    position:fixed;
    }

.f-menu {
    z-index: 9999;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    } /* isso vai fazer o menu ficar fixo no topo */

.menu {
height: 100px;
left: 0;
top: 0;
z-index: 9999;
background: #fff repeat-x 0 0;
position:fixed; width:100%
}

.menu ul {
    list-style: none;
    font-family: 'Source Sans Pro', sans-serif;
    font-size:17px;
    font-weight:bold;
    position: fixed;
    top: 0;
    right: 0;
    display: table-cell;
    vertical-align: middle;
    width: 100%;
    }

.menu ul li {
float: right;
padding-right:30px;
padding-top:0px;
}

.menu ul li:first-child {
    padding-left: 0;
    }

.menu ul li a {
    color:#000;
    text-decoration:none;
    border-top:3px solid #999;
    }

.menu ul li a:hover {
    color: #6D6D6D;
    border-top:3px solid #EA0000;
    }
/*your grid*/
.row, .o-que-fazemos, .como-fazemos, .quem-somos {
display: block;
float: left;
postiion: relative;
overflowhidden;
}

.o-que-fazemos {
    background-image: url('images/oqfazemosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;

}
.o-que-fazemos-content-1, .o-que-fazemos-content-2 {
 display: block;
 float: left;
 }

.o-que-fazemos-title {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#ffc709;
    font-weight:900;
    letter-spacing: 2px;
    }

.o-que-fazemos-subtitle {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#FFF;
    font-weight:900;
    letter-spacing: 2px;
    }
.o-que-fazemos-content-1 {  
    font-family: 'Source Sans Pro', sans-serif;
    font-size:20px;
    color:#FFF;
    text-align: left;
    }


.o-que-fazemos-content-2 {  

    text-align: right;
    }

.como-fazemos {
    background-image: url('images/comofazemosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    padding: 50px;
    }

.como-fazemos-title {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#FFF;
    font-weight:900;
    letter-spacing: 2px;
    }

.quem-somos {
    background-image: url('images/quemsomosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.a-equipe {
    background-image: url('images/EQUIPE-FUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.o-contato {
    background-image: url('images/contato-FUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.banner {
    position: relative;
    overflow: auto;
    }

.banner li {
    list-style: none;
    }

.banner ul li {
    float: left;
    }
/*CSS文档*/

html,body {
    height:100%;    
    margin:0;
    padding:0;
    border:0;
    }

div {
    margin:0;
    border:0;
    }

.login {
  display: table-cell;
}

logo {  
    border:0;
    z-index:9999;
    float:left;

    }

.menu-fundo {
    background: #fff repeat-x 0 0;
    left: 0;
    top: 0;
    z-index: 9999;
    position:fixed;
    }

.f-menu {
    z-index: 9999;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    } /* isso vai fazer o menu ficar fixo no topo */

.menu {
height: 100px;
left: 0;
top: 0;
z-index: 9999;
background: #fff repeat-x 0 0;
position:fixed; width:100%
}

.menu ul {
    list-style: none;
    font-family: 'Source Sans Pro', sans-serif;
    font-size:17px;
    font-weight:bold;
    position: fixed;
    top: 0;
    right: 0;
    display: table-cell;
    vertical-align: middle;
    width: 100%;
    }

.menu ul li {
float: right;
padding-right:30px;
padding-top:0px;
}

.menu ul li:first-child {
    padding-left: 0;
    }

.menu ul li a {
    color:#000;
    text-decoration:none;
    border-top:3px solid #999;
    }

.menu ul li a:hover {
    color: #6D6D6D;
    border-top:3px solid #EA0000;
    }
/*your grid*/
.row, .o-que-fazemos, .como-fazemos, .quem-somos {
display: block;
float: left;
postiion: relative;
overflowhidden;
}

.o-que-fazemos {
    background-image: url('images/oqfazemosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;

}
.o-que-fazemos-content-1, .o-que-fazemos-content-2 {
 display: block;
 float: left;
 }

.o-que-fazemos-title {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#ffc709;
    font-weight:900;
    letter-spacing: 2px;
    }

.o-que-fazemos-subtitle {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#FFF;
    font-weight:900;
    letter-spacing: 2px;
    }
.o-que-fazemos-content-1 {  
    font-family: 'Source Sans Pro', sans-serif;
    font-size:20px;
    color:#FFF;
    text-align: left;
    }


.o-que-fazemos-content-2 {  

    text-align: right;
    }

.como-fazemos {
    background-image: url('images/comofazemosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    padding: 50px;
    }

.como-fazemos-title {
    font-family: 'Source Sans Pro', sans-serif;
    font-size:80px;
    text-align:center;
    color:#FFF;
    font-weight:900;
    letter-spacing: 2px;
    }

.quem-somos {
    background-image: url('images/quemsomosFUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.a-equipe {
    background-image: url('images/EQUIPE-FUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.o-contato {
    background-image: url('images/contato-FUNDO.png');
    font-family: 'Source Sans Pro', sans-serif;
    background-repeat: repeat-x repeat-y;
    height:auto;
    font-size:28px;
    padding: 50px;
    }

.banner {
    position: relative;
    overflow: auto;
    }

.banner li {
    list-style: none;
    }

.banner ul li {
    float: left;
    }


它可以工作,但由于某种原因它“破坏”了DIV。请现场查看。你知道为什么吗?另外,我如何使content-1和content-2垂直对齐?它可以工作,但由于某些原因它“破坏”了分区。请查看live。你知道为什么吗?另外,我如何使content-1和content-2垂直对齐?它可以工作,但由于某些原因它“破坏”了分区。请查看live。你知道为什么吗?另外,我如何使content-1和content-2垂直对齐?它可以工作,但由于某些原因它“破坏”了分区。请查看live。你知道为什么吗?另外,如何使content-1和content-2垂直对齐?我已经尝试了这两种方法,但都没有效果。无论如何谢谢你!我两个都试过了,但什么也没发生。无论如何谢谢你!我两个都试过了,但什么也没发生。无论如何谢谢你!我两个都试过了,但什么也没发生。无论如何谢谢你!它正在运行,但由于某种原因,它“破坏”了我的下一页“Como fazemos”。当我点击链接时,它不起作用,而且它还“切”了一点顶部。试着将每个部分围成一个.row div.o-que-fazemos、.row{position:relative;display:block;float:left;overflow:hidden;ie7 bug fixed哪个div?只有主div,比如.o-que-fazemos、.como-fazemos、.quem-somos或.o-que-fazemos-content-1和content-2?我所要做的就是在名称后面添加.row?只是你的主部分在工作,但由于某种原因它“中断”我的下一个页面“Como fazemos”。当我点击链接时,它不起作用,而且它也“剪切”了一点顶部。请尝试将每个部分包含在.row div.o-que-fazemos、.row中{position:relative;display:block;float:left;overflow:hidden;ie7 bug fixed哪个div?只有主div,比如.o-que-fazemos、.como-fazemos、.quem-somos或.o-que-fazemos-content-1和content-2?我所要做的就是在名称后面添加.row?只是你的主部分在工作,但由于某种原因它“中断”我的下一个页面“Como fazemos”。当我点击链接时,它不起作用,而且它也“剪切”了一点顶部。请尝试将每个部分包含在.row div.o-que-fazemos、.row中{position:relative;display:block;float:left;overflow:hidden;ie7 bug fixed哪个div?只有主div,比如.o-que-fazemos、.como-fazemos、.quem-somos或.o-que-fazemos-content-1和content-2?我所要做的就是在名称后面加上。行吗?只是你的主部分在工作,b