html - 如何内嵌div元素?

标签 html css

我正在尝试将这两个 div 内联

HTML

<div class="thisFlak">
</div>

<div class="thisFlakNotes">
</div>

CSS

.thisFlak{
  width: 603px;
  height: 253px;
  border: 2px solid red;
  margin-left: 10px;
  margin-bottom: 30px;
}
.thisFlakNotes{
  width: 100px;
  height: 200px;
  border: 1px solid black;
  background: white;
}

我不能把“.thisFlak”搞得一团糟,因为它包含很多其他东西。

fiddle
https://jsfiddle.net/xwzcbn6w/

最佳答案

DEMO

CSS

.thisFlak {
  width: 603px;
  height: 253px;
  border: 2px solid red;
  margin-left: 10px;
  margin-bottom: 30px;
  /* to make it inline */
  display: inline-block; 
  /* aligning vertically you can make it top / bottom / baseline */
  vertical-align: middle
}

.thisFlakNotes {
  width: 100px;
  height: 200px;
  border: 1px solid black;
  background: white;
  /* to make it inline */
  display: inline-block;
  /* aligning vertically you can make it top / bottom / baseline */ 
  vertical-align: middle 
}

关于html - 如何内嵌div元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39118656/

相关文章:

html - 为什么不按空格键而 `label` 在 `[for=""]` attr 中有焦点检查单选按钮?

javascript - 获取 iframe 中悬停元素的 css 值

css - SVG响应曲线线

javascript - 如何在 css 中水平包裹垂直溢出?

javascript - 如何在 extjs 中正确设置按钮的图标大小?

css - Bootstrap Split 按钮下拉列表大小不一样

javascript - 从日期选择器获取日期

html - IE6 float div 无法正确清除

html - 如何在 github 托管站点中将我的 CSS 链接到我的 HTML

javascript - YouTube 嵌入视频播放器的外部播放按钮