小编dip*_*pas的帖子

Flexbox行在flexbox列中

我有这样的布局:

<div class="flexbox">
  <div class="header"></div>
  <div class="main"></div>
  <div class="footer"></div>
</div>
Run Code Online (Sandbox Code Playgroud)

和它的css:

html,
body {
  height: 100%;
}
.flexbox {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-content: stretch;
  align-items: flex-start;
  height: 100%;
  width: 100%;
}
.flexbox .main {
  order: 0;
  flex: 1 1 auto;
  align-self: stretch;
}
.flexbox .header,
.flexbox .footer {
  order: 0;
  flex: 0 1 auto;
  align-self: stretch;
}
Run Code Online (Sandbox Code Playgroud)

在上面的.main列中拉伸100%height,这一切都很完美,现在添加.flexbox-row内部.main:

<div class="flexbox">
  <div class="header"></div>
  <div class="main">
    <div class="flexbox-row">
      <div …
Run Code Online (Sandbox Code Playgroud)

html css css3 flexbox

5
推荐指数
1
解决办法
8482
查看次数

你可以在内置类的bootstrap中为表添加背景颜色吗?

中有什么办法可以使用内置的bootstrap配色方案吗?这段代码不起作用,我尝试使用"Active"和"Success"代替颜色background-color,但它们不起作用.

<table class="table table-bordered background-color: white">
  <thead>
    <tr>
      <th>example table</th>
    </tr>
  </thead>
</table>
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap twitter-bootstrap-3

5
推荐指数
2
解决办法
3万
查看次数

选择以类名开头并包含部分字符串的元素

我要选择带有类但名为“path_from”等的元素。

让我给你举个例子

<div class='path_from_5_to_6'></div>
<div class='_6'></div>
<div class='path_from_6_to_5'></div>
<div class='path_from_3_to_2'></div>
Run Code Online (Sandbox Code Playgroud)

我想选择哪个类以 path_from 开头但包含“_6”的元素

我怎样才能做到这一点?

html css css-selectors

5
推荐指数
1
解决办法
2643
查看次数

将圆角边框添加到元素的选定角上

我怎么能用纯CSS来构建这样的东西呢?

SS

到目前为止,我已经走了多远:小提琴

即使我继续添加额外的spans ,我也在努力想要在那里获得圆角.


码:

body {
  background: #000;
}

.container {
  position: relative;
  width: 300px;
  height: 150px;
  margin: 10% auto;
}

.top-right {
  position: absolute;
  top: -10px;
  right: 0;
  width: 50px;
  height: 1px;
  background: white;
  border-radius: 5px;
}

.box {
  width: 100%;
  height: 100%;
  background: red;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

h3 {
  color: white;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container">
  <span class="top-right"></span>
  <div class="box">
    <h3>Content</h3>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

html css rounded-corners css3 css-shapes

5
推荐指数
2
解决办法
854
查看次数

样式未应用于CSS中的H1元素

我面临一个奇怪的问题,风格没有应用于H1元素.

码:

p h1 {
  color: red;
}
Run Code Online (Sandbox Code Playgroud)
<p>
  <h1>This is a header</h1>
</p>
Run Code Online (Sandbox Code Playgroud)

html css html-heading

5
推荐指数
1
解决办法
1795
查看次数

@supports css calc函数

有没有办法在@supports(propertyName,value)中使用calc函数?我的意思是只在calc函数的位置.<supports_condition>

@supports ( <supports_condition> ) {
    .col-3 {
    width: calc(25% - 20px/4)
    }
    .col-4 {
        width: calc(33.3333333% - 20px/3)
    }
    .col-6 {
        width: calc(50% - 20px/2)
    }
}
Run Code Online (Sandbox Code Playgroud)

css css3 css-calc

4
推荐指数
1
解决办法
1646
查看次数

如何在列表编号中为单词添加前缀

所以我搜索了高低,并且无法找到一个看似简单问题的答案.

我有一个这样的有序列表:

<ol>
  <li>Some text here</li>
  <li>Some more text here..</li>
  <li>Oh yeah, here's some pretty text</li>
</ol>
Run Code Online (Sandbox Code Playgroud)

哪个显示:

  1. 这里有一些文字
  2. 这里还有一些文字..
  3. 哦,是的,这里有一些漂亮的文字

我想真正展示的内容:

步骤1.这里有一些文字

第2步.这里有更多文字..

第3步.哦,是的,这里有一些漂亮的文字

问题:这是否可能,如果可行,如何在不使用可疑解决方案的情况下进行此操作?

html css html-lists pseudo-element

4
推荐指数
1
解决办法
1041
查看次数

样式无法在Gmail中使用

我正在致力于向各种电子邮件客户端发送电子邮件(例如yahoo,hotmail,gmail,....).

我有一个id为div的div OrderInfo,我有一个生成动态表的变量.

HTML

<div id="OrderInfo">
  variable 
</div>
Run Code Online (Sandbox Code Playgroud)

动态生成th带小写的headers(),所以我想将其更改为大写和更多样式.所以我写了一个选择器

CSS

#OrderInfo table tr th {
  text-transform: uppercase;
  background-color: #737373;
  color: white;
}
Run Code Online (Sandbox Code Playgroud)

这适用于雅虎,hotmail但不适用于Gmail.

我发现只有内联样式适用于gmail,但我怎样才能修改动态样式.

我无法控制变量(我在div中提到)它生成一个表,其中包含在发送到客户端时处理的值.

所以我不能保留静态表,也不能改变它呈现的方式

html css email html-email

4
推荐指数
3
解决办法
1万
查看次数

在javascript中用空格替换所有<br>标记

遇到非常简单的问题,如何正确地用空格替换所有< br><br>字符串?

这是我正在尝试使用的,但我收到的是相同的字符串:

var finalStr = replaceAll(replaceAll(scope.ItemsList[i].itemDescr.substring(0, 27), "<", " "), "br>", " ");
function replaceAll(str, find, replace) {
    return str.replace(new RegExp(find, 'g'), replace);
}
Run Code Online (Sandbox Code Playgroud)

javascript regex

4
推荐指数
1
解决办法
8434
查看次数

如何在有序列表中组合数字和字母?

如何在 CSS 中使用数字和字母递增有序列表:

    ol.nested { 
        margin-bottom: 0;
        counter-reset: item;
    }
    
    ol.nested li { 
        display: block;
        position: relative;
    }
    
    ol.nested li:before { 
        content: counters(item, ".", decimal) "."; 
        counter-increment: item;
        position: absolute;
        margin-right:100%;
        right: 10px;
    }
Run Code Online (Sandbox Code Playgroud)
<ol class="nested">
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3
    <ol class="nested">
        <li>Show Item 3.a instead of 3.1</li>
        <li>Show Item 3.b instead of 3.2</li>
        <li>Show Item 3.c instead of 3.3</li>
    </ol>
    </li>
    <li>Item 4
	<ol class="nested">
        <li>Show Item 4.a instead of 4.1</li>
        <li>Show Item 4.b instead of 4.2</li> …
Run Code Online (Sandbox Code Playgroud)

html css css-counter

4
推荐指数
1
解决办法
2840
查看次数