小编Niv*_*gam的帖子

在eclipse中的<head> </ head>中缩进标签

<head>...</head>当我按下Ctrl + Shift + F时,我需要Eclipse(Kepler)缩进html标签

目前,这个:

<html>
<head>
<title>Insert title here</title>
<script type="text/javascript">
function func() {
console.log("Hello world");
}
</script>
</head>
<body>
<p onclick="func()">Some text</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

当我按下组合键时变成这个.

<html>
<head>
<title>Insert title here</title>
<script type="text/javascript">
    function func() {
        console.log("Hello world");
    }
</script>
</head>
<body>
  <p onclick="func()">Some text</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

我需要<head>...</head>缩进内部的所有内容以及其中的所有标记<html>...</html>.

理想情况下这样:

function func() {
  console.log("Hello world");
}
Run Code Online (Sandbox Code Playgroud)
<html>

<head>
  <title>Insert title here</title>
  <script type="text/javascript">
    /* function */
  </script>
</head>

<body>
  <p onclick="func()">Some text</p> …
Run Code Online (Sandbox Code Playgroud)

html eclipse indentation auto-indent

21
推荐指数
1
解决办法
1118
查看次数

使用google maps api v3中的自动完成服务获取邮政编码

我正在使用google maps api V3中的autocompleteservice来进行自定义自动完成输入.我基本上调用此函数来检索城市建议.

function getPlaces(st){
    gService.getQueryPredictions({input:st,types:['geocode']},function(predictions,status)      {
        if(status != google.maps.places.PlacesServiceStatus.OK) return false;
        for(var i = 0, prediction; prediction = predictions[i]; i++){
            console.log(prediction);
        }
        return predictions;
    });
}
Run Code Online (Sandbox Code Playgroud)

这很好用,但我希望得到与城市相关的邮政编码.与V2 api一样,请参阅此示例.

我试图将类型选项更改为城市,但结果是相同的.知道怎么做吗?

javascript google-maps-api-3

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

如何在 Redux 表单中有可搜索的下拉列表

我正在使用 redux-form 中的字段数组,我的表单中需要一个可搜索的下拉菜单。我知道可以像这样完成正常的下拉菜单,

<Field name={`${object}.method`} component="select" validate={required} id={`${object}.key`}>
       <option value="id">id</option>
       <option value="css">css</option>
       <option value="xpath">xpath</option>
       <option value="binding">binding</option>
       <option value="model">model</option>
</Field>
Run Code Online (Sandbox Code Playgroud)

但这不是可搜索的下拉列表。即使我要使用它,这也只是提供了一个基本的 html 选择,我如何才能将 css 样式应用于它以使其与其他引导程序元素匹配?

为了有一个可搜索的下拉列表,我正在使用react-select包。我试图做的是;

<Field
    name={`${object}.method`}
    type='text'
    component={this.renderDropdown}
    label="Method"
    validate={required}
    id={`${object}.key`}
    valueField='value'
/>

renderDropdown = ({ input, id, valueField, meta: { touched, error }, ...props }) => {
    return (
        <React.Fragment>
            <div className='align-inline object-field-length'>
                <Select {...input} id={id} value={input.value.value} onChange={input.onChange}
                    options={[
                        { value: 'id', label: 'id' },
                        { value: 'css', label: 'css' },
                        { value: 'xpath', label: 'xpath' …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-select redux-form react-redux

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

bootstrap 4 alpha 中的全宽导航标签

您好,如何使我的导航标签全宽,我尝试使用width:100%;无济于事。 在此处输入图片说明

这是我使用的 html 代码。

<ul class="nav nav-tabs" role="tablist">
  <li class="nav-item">
    <a class="nav-link active" data-toggle="tab" href="#home" role="tab">Home</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" data-toggle="tab" href="#learn" role="tab">Learn More</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" data-toggle="tab" href="#faq" role="tab">Frequently Asked Questions</a>
  </li>
</ul>
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap

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

JQuery 数据表滚动条和列搜索不起作用

我正在使用JQuery DataTables并尝试添加滚动条以适应屏幕以及标题中的列搜索。它正在破坏标题(如果我点击排序,那么我的自定义标题就会消失)并且搜索不起作用(仅在滚动条存在时发生)。

我的代码(不要更改 html,因为我正在动态添加所有数据):

var table = $('#example').DataTable({
  "scrollX": true,
});

$('#example thead th').each(function() {
  var title = $(this).text();
  $(this).html('<input type="text" placeholder="' + title + '" />');
});

table.columns().every(function() {
  var that = this;

  $('input', this.header()).on('keyup change', function() {
    if (that.search() !== this.value) {
      that
        .search(this.value)
        .draw();
    }
  });
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table id="example" class="display nowrap" cellspacing="0" width="100%">
  <thead>
    <tr>
      <th>First name</th>
      <th>Last name</th>
      <th>Position</th>
      <th>Office</th>
      <th>Age</th>
      <th>Start date</th>
      <th>Salary</th>
      <th>Extn.</th>
      <th>E-mail</th>
    </tr>
  </thead> …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery datatables

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

如何使用Bootstrap 4垂直对齐按钮内容

我在应用程序中使用bootstrap 4和材料图标。问题是当我同时具有文本和图标的按钮时。

.button-icon {
  vertical-align: middle;
}
Run Code Online (Sandbox Code Playgroud)
<button class="button-icon">
    <i class="material-icons">account_box</i>
    My Account
</button>
Run Code Online (Sandbox Code Playgroud)

我尝试过更改图标的字体大小,但是这会使整个页面中其他图标的大小变小。

我只是想使文本与图标对齐。感谢您的任何帮助。

html css twitter-bootstrap bootstrap-4 google-material-icons

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

使用 VUE 在一页上创建多个模态

正如标题所暗示的,我想在一页上添加两个模态对话框。我想出了如何创建,但第二个我遇到了麻烦。

HTML:

<body>
  <h1>-projects-</h1>
  <ul id="button-container">
    <li>
      <a id="html-modal-button" @click="showModal = true">
        <img class="htmllogo" src="images/HTMLLogo.png">
        <div class="html-text-block">
          <h2>HTML</h2>
          <p>My web projects</p>
        </div>
      </a>
      <htmlmodal v-if="showModal" @close="showModal = false"></htmlmodal>
    </li>

    <li>
      <a id="cs-modal-button" @click="showModal = true">
        <img class="csharplogo" src="images/CSHARPLogo.png">
        <div class="cs-text-block">
          <h2>C#</h2>
          <p>My windows projects</p>
        </div>
      </a>
      <csmodal v-if="showModal" @close="showModal = false"></csmodal>
    </li>
  </ul>

  <!-- MODAL SECTION -->
  <script type="text/x-template" id="html-modal-template">
    <transition name="html-modal">
      <div class="modal-mask">
        <div class="modal-wrapper">
          <div class="modal-container">
            <div class="modal-header">
              <slot name="header">HTML HEADER</slot>
            </div>
            <div class="modal-body">
              <slot name="body">HTML BODY</slot>
            </div> …
Run Code Online (Sandbox Code Playgroud)

html javascript vue.js

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

h4 边距的 CSS 无效属性值

我想用styles.css更改h4元素的matgins

在 HTML 文件中,h4 嵌套如下:

main div h4 {
  margin: 20px, 0, 0, 0;
  /* want to change top margin */
}
Run Code Online (Sandbox Code Playgroud)
<main role="main" class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5">
  <div style="padding-top: 1.0rem;">
    <ul>...</ul>
    <h4 id='sec_summary'>Summary</h4>
  </div>
</main>
Run Code Online (Sandbox Code Playgroud)

在styles.css 中定义的其他样式工作正常。但是当我试图以上面显示的方式设置 h4 边距时,我尝试了不同的数字和单位,h4 的边距根本没有改变。为什么代码不起作用?

html css margin

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