html - 将带有文本 "my name"的跨度放置在圆形 div 旁边

标签 html css

我正在尝试使带有文本“我的名字”的 span 站在圆形 div 旁边。两者的 display 属性都设置为 inline-block 但它仍然卡住了。密码是in this link .

.container {
  position: absolute;
  width: 382px;
  height: 529px;
  border: 1px solid black;
  background-color: #cccccc;
}
header {
  position: relative;
  width: 100%;
  height: 41px;
  color: white;
  background-color: #de4b4b;
  font-weight: bold;
  font-size: 14px;
  margin: auto;
}
header span {
  display: inline-block;
  padding-left: 172px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.sub-header {
  position: relative;
  width: 100%;
  height: 37px;
  background-color: white;
  font-size: 10px;
  margin: auto;
  color: black;
}
.sub-header span {
  display: inline-block;
  padding-top: 14px;
  padding-left: 10px;
}
.dialog-box1 {
  position: absolute;
  width: 365px;
  background-color: white;
  margin: 10px 8px 10px 8px;
  border: 1px solid #cccccc;
}
.dialog-box1-circle {
  display: inline-block;
  position: relative;
  width: 35px;
  height: 35px;
  border-radius: 30px;
  background-color: #cccccc;
  margin: 15px 10px 17px 15px;
}
.dialog-box-name {
  display: inline-block;
  color: #6495ED;
  font-size: 12px;
  width: 100%;
}
.dialog-box-text {
  color: #cccccc;
  font-size: 10px;
  font-family: 'roboto_light';
  margin-left: 15px;
}
<!doctype html>

<body>
  <div class="container">
    <header><span>Note</span>
    </header>
    <div class="sub-header"><span>Friday 25.7.13 </span>
    </div>
    <div class="dialog-box1">
      <div class="dialog-box1-circle"></div>
      <span class="dialog-box-name">My Name</span>
      <span class="dialog-box-text">Dont forget to bring the new calender for the meeting.</span>
    </div>
  </div>
</body>

最佳答案

从 span 中删除 css 显示

并添加css vertical align:middle on the circle

关于html - 将带有文本 "my name"的跨度放置在圆形 div 旁边,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30372853/

相关文章:

javascript - 当图像处于事件状态时显示 div

javascript - 推送在 javascript 中无法正常工作

html - 桌面和移动设备的响应图像列一个下面

CSS 特异性 - 内部样式、内联样式和外部样式

javascript - 水平下拉菜单 Umbraco

html - 以横向模式从 HTML 打印 SVG

javascript - 自定义 Google Charts 以在图表中显示文本/数字

html - 变换 : translate Not working across all browsers

javascript - XTK:找不到给定的容器

乱序显示的 HTML 元素