小编use*_*181的帖子

如何在引导程序中将容器垂直对齐

我正在寻找一种垂直居中对齐containerdiv的方法,jumbotron并将其设置在页面中间.

.jumbotron必须适应屏幕的整个高度和宽度,所以我用这个CSS.

.jumbotron {
  height:100%;
  width:100%;
}
.container {
  width:1025px;
}
.jumbotron .container {
  max-width: 100%;
} 
Run Code Online (Sandbox Code Playgroud)

.containerdiv有一个宽度1025px和应在该页面(垂直中心)的中间.

<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="jumbotron">
    <div class="container text-center">
        <h1>The easiest and powerful way</h1>
        <div class="row">
            <div class="col-md-7">
                 <div class="top-bg"></div>
            </div>

            <div class="col-md-5 iPhone-features" style="margin-left:-25px;">
                <ul class="top-features">
                    <li>
                        <span><i class="fa fa-random simple_bg top-features-bg"></i></span>
                        <p><strong>Redirect</strong><br>Visitors where they converts more.</p>
                    </li>
                    <li>
                        <span><i class="fa fa-cogs simple_bg top-features-bg"></i></span>
                        <p><strong>Track</strong><br>Views, Clicks and Conversions.</p>
                    </li>
                    <li>
                        <span><i class="fa …
Run Code Online (Sandbox Code Playgroud)

html css vertical-alignment twitter-bootstrap twitter-bootstrap-3

315
推荐指数
6
解决办法
79万
查看次数

laravel在此服务器上找不到请求的URL

我有一个Ubuntu 14.04内核.我在这台服务器上安装了我的Laravel应用程序.安装后,我尝试将根目录设置为public.

sudo nano /etc/apache2/sites-available/000-default.conf
Run Code Online (Sandbox Code Playgroud)

我在文件中只有这些选项

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port t$
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last …
Run Code Online (Sandbox Code Playgroud)

apache ubuntu laravel laravel-4

53
推荐指数
5
解决办法
10万
查看次数

向下滚动一下后,我怎么能坚持div

当我们向下滚动页面并且第二个div遇到顶部边界时,我想坚持第二个div.当它被修复时,它应该与其他页面一起滚动.我怎样才能做到这一点?

#settings{
    width:100%;
    background:#383838;
    height:60px;
}
#menu{
    width:100%;
    position:relative;
    height:100px;
    background:#aaa;
}
#body-content{
    height:900px;
    position:relative;
}
Run Code Online (Sandbox Code Playgroud)

和HTML

<body>
<div id="top">
    <div id="settings">
    </div>
    <div id="menu">
    </div>
</div>
<div id="body-content">
</div>

</body>
Run Code Online (Sandbox Code Playgroud)

在这个例子http://jsfiddle.net/WBur3/中,当我们滚动页面时,应该修复第二个div.当我们向上滚动时,应该变成先前的状态本身.请帮我.

html javascript css

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

无法从PHP中获取数据库的值

我正在尝试使用以下代码从数据库中获取值

    $request = Registrationrequest::where('course_id', $id)
                                   ->where('user_id', Auth::user()->id)
                                   ->where('registered', true)->count();
Run Code Online (Sandbox Code Playgroud)

我正在使用Laravel.我有一排course_id = 4,user_id=3registered=true.当我分别对var_dump每个值进行var_dump时,我确认了它.但是当我一起使用这个条件时,我没有得到计数值为1,而是得到0.

我有另一个查询,我使用

$request = Registrationrequest::where('course_id', $id)
                                ->where('user_id', Auth::user()->id)
                                ->where('registered', false)->first();
Run Code Online (Sandbox Code Playgroud)

当注册值为false时,这非常有效.

有谁能告诉我哪里错了?

php sql laravel-4

9
推荐指数
1
解决办法
145
查看次数

将远程分支合并到另一个本地分支

这可能是一个重复的问题,但我无法弄清楚我该怎么做.我正在尝试将一个remoteBranch不是主分支的远程分支合并到我的本地分支localBranch.

我的一位开发人员为远程分支上的api端点添加了一个新分支remoteBranch.作为前端开发人员,我需要获取该分支并将其与我的本地开发分支合并localBranch以利用该api端点.我怎样才能做到这一点?

git github

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

homestead.rb:63:在`configure'中:未定义的方法`each'代表nil:NilClass(NoMethodError)

我按照如何安装Laravel,但毕竟当我进入"vagrant up"时我得到这些错误:

C:/Users/Renz/code/Homestead/scripts/homestead.rb:63:在configure': undefined m ethod每个'for nil:NilClass(NoMethodError)来自C:/ Users/Renz/code/Homestead/Vagrantfile:9:in call'from block in <top (requi red)>' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/v2/loader.rb:37:inC :load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/loader.rb:103:in/ HashiCorp/Vagrant/embedded/gems/ gems/vagrant-1.6.5/lib/vagrant/c onfig/v2/loader.rb:37:in block(2 level)in load'from C:/ HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/loader.rb:97:in in each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/loader.rb:97:inblock in load'from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/ lib/vagrant/c onfig/loader.rb:94:in each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/loader.rb:94:inload'from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/v agrantfile.rb:28:in initialize' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/e nvironment.rb:614:innew'来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/e nvironment.rb:614:在vagrantfile' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/e nvironment.rb:399:in主机'来自C:/ HashiCorp/Vagrant/embedded/gems/gems/vagrant- 1.6.5/lib/vagrant/e nvironment.rb:198:block in action_runner' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/a ction/runner.rb:33:in来自C的电话:/ HashiCorp/Vagrant/embedded/gems/gems /vagrant-1.6.5/lib/vagrant/ a ction/runner.rb:33 :run' …

configure vagrant laravel

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

使用Laravel将CSV文件上传到MySQL

我正在尝试将csv文件上传到usersLaravel中的表格.

这是我的php脚本:

private function _import_csv($path, $filename)
    {

        $csv = $path . $filename;
        $query = sprintf("LOAD DATA local INFILE '%s' INTO TABLE users FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' ESCAPED BY '\"' LINES TERMINATED BY '\\n' IGNORE 0 LINES (`firstname`, `lastname`, `username`, `gender`, `email`, `country`, `ethnicity`, `education`  )", addslashes($csv));
    return DB::connection()->getpdo()->exec($query);

}



public function uploadUsers(){


    if (Input::hasFile('fileInput')){

        $file = Input::file('fileInput');
        $name = time() . '-' . $file->getClientOriginalName();

        $path = 'public/uploads/'.date('Y/m/');

        $file->move($path, $name);
        $this->_import_csv($path, …
Run Code Online (Sandbox Code Playgroud)

php mysql csv laravel laravel-4

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

Flex中的Flex项目溢出

我正在尝试创建一个第一行的表单,单个文本字段100%宽度和第2行3个字段等距.它适用于Chrome.然而,它在FireFox上溢出.

.form {
  display: flex;
  flex-direction: column;
  width: 300px;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.form input {
  width: 100%;
  padding: 20px;
}

.form .number {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form .expiry {
  display: flex;
  width: 100%;
  justify-content: space-between;
}
Run Code Online (Sandbox Code Playgroud)
<div class="form">
  <div class="number">
    <input data-stripe="number" placeholder="Credit Card Number" class="" type="text">
  </div>
  <div class="expiry">
    <input data-stripe="exp-month" placeholder="MM" class="" type="text">
    <input data-stripe="exp-year" placeholder="YY" class="" type="text">
    <input data-stripe="cvc" placeholder="CVC" class="" type="text">
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

https://jsfiddle.net/xhr031yr/2/

html css css3 flexbox

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

date-fns 在 Safari 上返回无效日期

我用来date-fns返回一些值,如下所示:

import { format, formatDistance } from "date-fns";

var date = new Date("2019-03-06 00:00:00");
console.log(format(new Date(date), "dd MMM, y"));
Run Code Online (Sandbox Code Playgroud)

它在 Chrome 上运行良好并返回We Mar, y

Invalid Date在 Safari 中返回。

我相信这是因为日期(“2019-03-06 00:00:00”)不是 ISO 8601 格式。但这是我从端点接收的格式。是否有任何选项可以将其转换为正确的格式并使其在 Safari 上运行?

javascript date date-fns

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

在 nuxtjs 应用程序中禁用服务工作者或工作箱

我正在尝试使用该nuxt generate命令生成一个 nuxt 应用程序。我想通过打开index.html文件dist夹中的文件来使用它。除了我加载一些静态资产的一页外,一切正常。我收到以下错误:

DOMException: 无法构造 'Worker': 'file:///Users/web-app/dist/_nuxt/a694c9435aa306bfdc85.worker.js' 处的脚本无法从原点 'null' 访问。在新的 e.exports (file:///Users/web-app/dist/_nuxt/ddebbd7698f3519f1f2a.js:2:387818) 在 Object.253 (file:///Users/web-app/dist/_nuxt/ddebbd7698f3519f1f1f1f3519f1f2a.js:2:387818) .js:2:41913) 在 c (file:///Users/web-app/dist/_nuxt/849a5edcbb351f009715.js:1:534) 在 Module.318 (file:///Users/web-app/dist /_nuxt/58dff71a539121ee82b0.js:1:7082) 在 c (file:///Users/web-app/dist/_nuxt/849a5edcbb351f009715.js:1:534)

这是我的nuxt.config.js文件:


export default {
  mode: 'spa',
  /*
  ** Headers of the page
  */
  head: {
    title: process.env.npm_package_name || '',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
    ],
    link: [ …
Run Code Online (Sandbox Code Playgroud)

service-worker progressive-web-apps nuxt.js

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