html - Flexbox SVG 不与其他元素内联

标签 html css svg flexbox

我正在尝试对齐 svg 和一些由 flexbox 容器包装的内联 li 元素。出于某种原因,最后的 svgs 没有与其他 svgs 内联。 CSS:

.container{
    margin-left:20px;
    display:inline-flex;
    flex-direction: row;
    justify-content: left;
    flex-wrap: wrap;

}

.logo{
    width: auto;
    fill:orange;
    height: 57px;
}
.menu{

    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: space-between;
}
.menu li {
    padding:30px;
    list-style: none;
}
.secondmenu{
    display:flex;
    flex-direction: row;
    justify-content: flex-end;
}

.secondmenu  svg{
    padding: 10px;

    width: 3%;
  }

这是带有 html 的代码笔:

https://codepen.io/anon/pen/eboMOQ

最佳答案

到此为止,lastpeony4 稍微清理了您的代码,这应该让您开始了。 https://codepen.io/anon/pen/xmeWBO?editors=1100

.container{
    margin-left:20px;
    display:flex;
    flex-direction: row;
}
.logo{
    width: auto;
    fill:orange;
    height: 57px;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  display: flex;
  flex-grow: 1;

}

ul li {
  padding: 1rem
}

.svg-container {
  display: flex;
}

.svg-container svg {
  height: 20px;
    padding: 1.8rem 1rem;
}

关于html - Flexbox SVG 不与其他元素内联,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54224036/

相关文章:

php - TTF 字体不显示在动态 SVG 中

javascript - 是否可以包含压缩文件中的 javascript 文件?

html - 防止旧的 css 文件干扰 Bootstrap 导航栏

internet-explorer - SVG未在Firefox和IE中使用Kendo模板渲染

html - 为什么媒体查询的优先级低于无媒体查询 css

jquery - 如何将标签添加到 Chart.js Canvas 插件中?

javascript - jQuery 在鼠标悬停在 php 上制作样式 css

html - 我在容器背景和前景中有 2 张图像。如何使前景图像响应

javascript - 选择选项后,将事件类添加到 SVG map 上的多边形

javascript - 如何在表格中添加按钮