简体   繁体   English

CSS 没有移动到同一行

[英]CSS not shifting to same line

I am having an issue where two "members" in my website are not showing on the same line.我遇到了一个问题,我的网站中的两个“成员”没有显示在同一行上。

Here is my HTML:这是我的 HTML:

<h4>Our Team</h4>
    <div class='member'>
        <div class='image'>
            <img src='aj.png'>
        </div>
    <div class='info'>
            <div class='name'>Austin</div>
            <div class='title'>Curator</div>
    </div>
   </div>
    <div class='member'>
        <div class='image'>
            <img src='aj.png'>
        </div>
    <div class='info'>
            <div class='name'>Austin</div>
            <div class='title'>Curator</div>
    </div>
   </div>

Here is my CSS:这是我的 CSS:

.member
{
  width:50%;
  float:left;
  padding:15px 0;
}

.wrapper .right .section .member .image
{
  float:left;
  margin-right:15px;
  width:100px;
  height:100px;
  background-color:#eee;
  -moz-border-radius:51px;
  -webkit-border-radius:51px;
  border-radius:51px;
  background-position:center;
  background-size:cover;
  background-repeat:no-repeat;
}

.wrapper .right .section .member .image img
{
  width:100px;
  height:100px;
}

.wrapper .right .section .member .info
{
  padding-top:20px;
  float:left;
}

.wrapper .right .section .member .info .name
{
  font-family:HelveticaNeue-Bold, "Helvetica Neue Bold", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
  font-weight:700;
  color:#333;
  font-size:15px;
}

.wrapper .right .section .member .info .title
{
  margin-top:2px;
  font-family:HelveticaNeue, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
  font-weight:400;
  font-style:italic;
}

Ideally, I would like the ability for both members to be able to show up on the same line.理想情况下,我希望两个成员都能够出现在同一条线上。 Right now it's just going above and below.现在它只是上下移动。

Actually it looks like you're not closing your div tags properly.实际上,您似乎没有正确关闭 div 标签。 Try this:尝试这个:

<h4>Our Team</h4>
<div class="member">
    <div class="image">
        <img src="aj.png">
    </div>
    <div class="info">
        <div class="name">Austin</div>
        <div class="title">Curator</div>
    </div>
 </div>
<div class="member">
    <div class="image">
        <img src="aj.png">
    </div>
    <div class="info>
        <div class='name'>Austin</div>
        <div class='title'>Curator</div>
    </div>
</div>

jsfiddle: http://jsfiddle.net/YTzL4/1/ jsfiddle: http : //jsfiddle.net/YTzL4/1/

Have a look at this.看看这个。 Have made some modifications to the css.对css做了一些修改。

http://jsfiddle.net/mail2zam/T49pg/ http://jsfiddle.net/mail2zam/T49pg/

.member{ 
width:50%;
float:left;
padding:15px 0;}

.member .image{ 
float:left;margin-right:15px;
width:100px;
height:100px;
background-color:#eee;
-moz-border-radius:51px;
-webkit-border-radius:51px;
border-radius:51px;
background-position:center;
background-size:cover;
background-repeat:no-repeat} 

.member .image img{
width:100px;height:100px;}

.member .info{
padding-top:20px;float:left}

.member .info .name{
font-family:"HelveticaNeue-Bold", "Helvetica Neue Bold", "Helvetica Neue", Helvetica,     Arial, "Lucida Grande", sans-serif;font-weight:bold;color:#333;font-size:15px}

.member .info .title{
margin-top:2px;font-family:"HelveticaNeue", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;font-style:italic}

It appears to be working on my end I have also included a fiddlin also.它似乎对我有用,我还包括了一个小提琴手。

http://www.fiddl.in/RH6CV4dqg http://www.fiddl.in/RH6CV4dqg

Can you tell me which browser it is not displaying correctly in?你能告诉我它在哪个浏览器中显示不正确吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM