小编And*_*hiu的帖子

`col-xs-*`在Bootstrap 4中不起作用

我之前没有遇到过这种情况,我很难找到解决方案.当引导程序中的列等于中等时,如下所示:

<h1 class="text-center">Hello, world!</h1>

  <div class="container">
      <div class="row">
          <div class="col-md-12 text-center">
              <h1>vicki williams</h1>
          </div>
      </div>
  </div>
Run Code Online (Sandbox Code Playgroud)

text-align工作正常: 在此输入图像描述

但是当使列等于超小时,如下所示:

 <div class="container">
      <div class="row">
          <div class="col-xs-12 text-center">
              <h1>vicki williams</h1>
          </div>
      </div>
  </div>
Run Code Online (Sandbox Code Playgroud)

然后text-align不再有效: 在此输入图像描述

是否有一些我不理解的引导概念,或者这实际上是一个像我认为的那样的错误.我从来没有遇到过这个问题,因为我的文本在过去与xs始终保持一致.任何帮助将不胜感激.这是我的完整代码:

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
  </head>
  <body>
    <h1 class="text-center">Hello, world!</h1>

      <div class="container">
          <div class="row">
              <div class="col-xs-12 text-center">
                  <h1>vicki williams</h1>
              </div>
          </div>
      </div>

    <!-- jQuery first, then Tether, …
Run Code Online (Sandbox Code Playgroud)

html css text-alignment twitter-bootstrap twitter-bootstrap-4

133
推荐指数
4
解决办法
8万
查看次数

使用CSS自定义类型编号输入的增量箭头

我有一个使用以下代码呈现的类型编号的输入:

<input class="quantity" id="id_form-0-quantity" min="0" name="form-0-quantity" value="1" type="number">

它看起来像这样:

在此输入图像描述

我想把它变成这样的东西:

在此输入图像描述

第二个视图使用两个单独的按钮进行模拟.

我怎么能按照描述设置箭头样式?

html css html5 textfield css3

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

为什么flex-child限于父母大小?

考虑以下示例......

body {
  margin: 0;
}

* {
  box-sizing: border-box;
}

.parent {
  min-height: 100vh;
  width: 50vw;
  margin: 0 auto;
  border: 1px solid red;
  display: flex;
  align-items: center;
  justify-content: center;
}

.child {
  border: 1px solid blue;
  width: 150%;
}
Run Code Online (Sandbox Code Playgroud)
<div class="parent">
	<div class="child">
	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Amet tellus cras adipiscing enim eu turpis. Neque aliquam vestibulum morbi blandit. Sem integer vitae justo eget …
Run Code Online (Sandbox Code Playgroud)

css centering flexbox

24
推荐指数
1
解决办法
3555
查看次数

log4js-node-DEP0004 - Angular 12 karma 单元测试中的弃用警告

在全新的 Angular 12 应用程序中运行单元测试时,我收到以下弃用警告:

(node:14940) [log4js-node-DEP0004] DeprecationWarning:模式 %d{DATE} 已被弃用,因为它在使用时会引起混乱。请改用 %d{DATETIME}。

在此输入图像描述

why log4js提示"karma" depends on it。警告本身很清楚应该做什么,但缺少两个关键信息:

  • 它没有说旧语法何时/是否停止工作
  • 它没有提供解决方法(除了分叉karma并用新语法替换已弃用的语法之外 - 我绝对不会这样做)。

降级log4js到早期版本,不会输出警告,使用forceResolutions似乎不是一个好主意,特别是因为我发现了一些与其中的漏洞相关的github线程,尽管业力似乎没有受到影响

问题:是否有可行的途径可以避免收到警告,或者“现在我们等待”(更新karma)是唯一的选择?

注意:我也在karma 的 repo上询问过。

unit-testing karma-runner karma-jasmine log4js-node angular-cli

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

如何垂直对齐Bootstrap v4模式对话框

Bootstrap 4中的垂直中心模态对话框.

注意:添加了以下要求以明确我正在寻找一种适当的方法来垂直居中Bootstrap模式,涵盖所有可能的设备,在所有浏览器中.在我的情况下,我想要一个大型SPA在整个应用程序中重用相同的模式,所以我需要它在每种情况下工作.

这应该:

  • 即使在高于设备高度的情况下,也可以在所有设备上访问模态内容
  • 适用于任何设备+浏览器组合,市场份额大于 1%
  • 不使用display:table-cell或类似的黑客(任何布局技术不意味着或设计用于布局)
  • 靠近clicktap在其外的任何地方.modal-content(包括上方和下方).
  • 尽可能限制jQuery/JavaScript的使用
  • (可选)处理默认的Bootstrap示例,无需进行标记修改

modal-dialog vertical-alignment flexbox bootstrap-modal bootstrap-4

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

页面加载时元素高度的差异

随着这个问题的发展,正确的标题应该是:页面加载时的体宽差异..它还与在页面中调整大小的图片有关.如果我们删除图片,差异就消失了.

请注意,这个问题不需要实际的解决方案(我可以用setTimeout()延迟脚本执行,问题就解决了).我在问,因为我想了解这种行为的技术方面.


在这里写一个答案的脚本时,在SO上,我发现如果在页面加载时或以后计算,元素的高度会有奇怪的差异.

这是片段:

document.initPictures = function() {
  $('.resizeMe').css({
    'height': $('#theContainer .col-sm-6').eq(1).height() + 6,
    'display': 'flex',
    'flex-direction': 'column',
    'transition': 'height .4s cubic-bezier(0.55, 0, 0.55, 0.2)'
  });
  $('.resizeMe img').each(function() {
    var src = $(this).attr('src');
    $('.resizeMe').append('<div style="flex-basis: 50%; background-image: url(' + src + '); background-size:cover; background-position: center center"' + '</div>');
    $(this).remove();
  })
};
document.resizePictures = function() {
  if ($('#theContainer').outerWidth() > 768) {
    $('.resizeMe').css({
      'height': $('#theContainer .col-sm-6').eq(1).height()
    });
  } else {
    $('.resizeMe').css({
      'height': $('.resizeMe').outerWidth()
    });
  }
};
$(window).resize(function() { …
Run Code Online (Sandbox Code Playgroud)

css jquery twitter-bootstrap-3

15
推荐指数
1
解决办法
2924
查看次数

Google广告使用链接预加载预加载,但在窗口加载事件后的几秒钟内未使用

当我访问我的网站时,即使我在页面底部设置了一个广告,也没有广告显示.它返回错误 - 资源https://pagead2.googlesyndication.com/pagead/js/r20181107/r20180604/show_ads_impl.js使用链接预加载预加载,但在窗口加载事件后的几秒钟内未使用.请确保它具有适当的as值并且有意预装.是的,adblocker已停用以下是我的广告代码:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-9121789382833091"
     data-ad-slot="8487804504"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
Run Code Online (Sandbox Code Playgroud)

javascript error-handling adsense

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

如何关闭 Vue 3 中的 productionTip 警告?

在 Vue 2 中可以使用

Vue.config.productionTip = false;
Run Code Online (Sandbox Code Playgroud)

关闭productionTip开发版本的警告。但是它不适用于 Vue 3:

Vue.config.productionTip = false;
Run Code Online (Sandbox Code Playgroud)
Vue.config && (Vue.config.productionTip = false);

const App = {
  data: () => ({
    foo: 'bar'
  })
};
Vue.createApp(App).mount('#app');
Run Code Online (Sandbox Code Playgroud)

vue.js vuejs3

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

设置宽度:自动导致宽度:100%

我现在有点累了(喝咖啡),所以我无法弄清楚这一点.

当我设置p.style.width = auto(蓝色)时,为什么它width100%?没有任何元素的宽度设置为100%,所以我怀疑它是继承属性.

如何设置<p>宽度以匹配其内容宽度加上填充?

示例页面链接

html css

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

如何从phpStorm中检索保存的ftp密码?

我知道从技术上讲,这个问题应该在phpStorm的论坛上提出,但是作为一个流行的IDE(我打赌最终的解决方案也适用于JetBrains的其他流行的IDE),我在想:

  • SO上的某个人可能知道并分享答案(比我从供应商那里获得的更快)
  • 问题的答案可能是其他程序员有用的,有价值的(对于这个问题,即使我需要去对供应商的论坛上,我会回来的答案在这里,当我找到它)

如果需要上下文:我意外地将已保存连接的连接类型切换ftplocal folder,当我切换回时,保存的凭据消失了.

问题:我可以检索保存的密码吗?

  • 角度1:......从这台电脑?
  • 角度2:...来自另一台保存了相同凭据的计算机,我可以通过TeamViewer访问,但有密码●●●●●●(隐藏)?

ftp setup-deployment password-recovery password-retrieval phpstorm

8
推荐指数
4
解决办法
9153
查看次数