小编Igo*_*ega的帖子

右对齐按钮组

这个按钮组只是不想对齐。我尝试向btn-groupdiv添加向右拉、向右文本、向右浮动的引导类。我试图更改类的文本对齐、填充、边距、浮动 css 属性buttons。没有任何帮助。仅当我将 padding-left 值设置为padding-left: 28px. 但这不是我要找的。我需要一个适用于一般情况的解决方案,但不去试验 padding-left 值需要多少像素。

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row issue">
  <div class="title col-md-7">
    <a href="https://www.google.com">Google</a>
  </div>
  <div class="buttons btn-group col-md-5">
    <button class="btn btn-success btn-sm">PR</button>
    <button class="btn btn-danger btn-sm">DEL</button>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

css twitter-bootstrap

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

webpack开发服务器无法加载资源

问题是Failed to load resource: the server responded with a status of 404 (Not Found)当我使用webpack-dev-server时出现此错误。但是,如果我只是构建项目,则可以运行我的程序index.html并获得预期的结果。我的项目结构是:

public/
  index.html
  assets/
src/
  index.js
Run Code Online (Sandbox Code Playgroud)

index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>PBWA</title>
</head>
<body>
  <div id="root"></div>
</body>
<script src="assets/bundle.js"></script>
</html>
Run Code Online (Sandbox Code Playgroud)

这是webpack配置文件

webpack.common.js

const path = require('path')
const CleanWebpackPlugin = require('clean-webpack-plugin')

module.exports = {
  entry: './src/index.js',
  plugins: [
    new CleanWebpackPlugin(['assets'])
  ],
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'public/assets')
  }
}
Run Code Online (Sandbox Code Playgroud)

webpack.dev.js

const merge = …
Run Code Online (Sandbox Code Playgroud)

webpack webpack-dev-server

6
推荐指数
1
解决办法
5962
查看次数

防止:悬停冒泡

如果我们将鼠标悬停在其子项上,如何阻止父元素悬停?

这是代码

const parent = document.getElementById('parent')
parent.onmouseover = function testAlert(e) {
  /* alert('parent') */
}
const childRight = document.getElementById('child-right')
childRight.onmouseover = function f(e) {
  e.stopPropagation()
  /* alert('child-right') */
}
const childLeft = document.getElementById('child-left')
childLeft.onmouseenter = function f(e) {
  e.stopPropagation()
  /* alert('child-right') */
}
Run Code Online (Sandbox Code Playgroud)
#parent {
  background: green;
  width: 100px;
  height: 100px;
  position: relative;
  margin: 0 auto;
}

#parent:hover {
  background: rgba(0, 0, 0, 0.8);
}

#child-left {
  background: red;
  width: 50px;
  height: 50px;
  position: absolute;
  top: 0;
  left: -50px;
} …
Run Code Online (Sandbox Code Playgroud)

html javascript css sass

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