小编its*_*_me的帖子

如何在Bootstrap 3的导航栏中添加带图标的搜索框?

我正在使用新的Twitter Bootstrap 3,我试图在顶部导航栏中放置如下(如下)的搜索框:

导航栏搜索

在Bootstrap 2中,它可以像这样完成:

<form class="form-search" method="get" id="s" action="/">
    <div class="input-append">
        <input type="text" class="input-medium search-query" name="s" placeholder="Search" value="">
        <button type="submit" class="add-on"><i class="icon-search"></i></button>
    </div>
</form>
Run Code Online (Sandbox Code Playgroud)

但是我不知道如何在Bootstrap 3中生成相同的内容,因为已经发生了很大变化.

Bootstrap 3中导航栏搜索框表单的默认HTML是:

<form class="navbar-form navbar-left" role="search">
    <div class="form-group">
        <input type="text" class="form-control" placeholder="Search">
    </div>
    <button type="submit" class="btn btn-default">Submit</button>
</form>
Run Code Online (Sandbox Code Playgroud)

如何修改它以实现我的需要?

html css html5 twitter-bootstrap twitter-bootstrap-3

135
推荐指数
3
解决办法
50万
查看次数

Google网络字体中"latin"与"latin-extended"字形支持的语言?

Google Web Fonts选择字符集

Google Web Fonts上的某些字体支持多个"字符集".问题是,如果我使用的网络字体仅提供"拉丁"字形,那么将页面翻译为不支持字形的语言的用户将清楚地注意到混乱的文本.

我希望我的网络字体支持除英语之外的世界上最流行的语言,例如西班牙语,德语,法语等.

为了这个目的,我想知道,"拉丁语"和"拉丁语"的语言完全符合哪种语言.

我希望答案看起来像:

Latin Character Set & Supported Languages:

- ..........
- ..........
- ..........

Latin-Extended Character Set & Supported Languages:

- ..........
- ..........
- ..........
Run Code Online (Sandbox Code Playgroud)

我无法在Google Web Fonts文档或Google搜索中找到此信息.

fonts glyph webfonts google-webfonts

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

使用Javascript:如果没有选项卡或窗口的历史记录,如何创建一个"返回"链接,将用户带到链接?

编辑2:答案似乎都没有用.甚至不是我之前标记为这个问题的答案.任何帮助表示赞赏.谢谢.

首先,我搜索了一个关于创建"返回"链接的方法,该链接允许用户返回上一页,这有两种方法:

<a href="javascript:history.go(-1)">[Go Back]</a>
Run Code Online (Sandbox Code Playgroud)

和...

<a href="#" onclick="history.go(-1);return false;">[Go Back]</a>
Run Code Online (Sandbox Code Playgroud)

这两个中的哪一个是更好的选择?为什么?(另外,请介绍一下浏览器兼容性.)

这是问题的一半.现在,如果我的第一页是用户访问的,那么"返回"链接将不起作用,对吧?(因为窗口或标签没有预先存在的历史记录.)在这种情况下,我希望链接回退并将用户带到http://example.com.

即如果历史存在,则用户将被带到上一页,如果不存在,则将其带到http://example.com.

我怎么做?希望有人能提供帮助.

编辑:请注意我不懂JavaScript,所以请你的答案解释.谢谢.

html javascript

58
推荐指数
6
解决办法
17万
查看次数

检查变量是否不等于多个字符串值的更简单方法?

现行代码:

<?php

  // See the AND operator; How do I simplify/shorten this line?
  if( $some_variable !== 'uk' && $some_variable !== 'in' ) {

    // Do something

  }

?>
Run Code Online (Sandbox Code Playgroud)

和:

<?php

  // See the OR operator; How do I simplify/shorten this line?
  if( $some_variable !== 'uk' || $some_variable !== 'in' ) {

    // Do something else

  }

?>
Run Code Online (Sandbox Code Playgroud)

是否有更简单(即更短)的方式来编写这两个条件?

注意:是的,它们是不同的,我期待缩短代码的不同方法.

php if-statement conditional-statements

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

如何从(官方)Google Web Fonts repo下载多种格式的Web字体?

我了解到Google会根据从中访问的浏览器/设备自动提供TTF,EOT,WOFFSVG字体文件.

现在我计划从我的服务器本身托管和提供字体文件,为此我首先必须下载网络字体的所有文件格式.

我如何或在哪里下载我想使用的网络字体的4种文件格式?

PS:通过使用不同的浏览器 - Chrome,IE9和Safari(dev - iPhone UA),我能够获得WOFF,EOT和TTF格式.但是,SVG格式没有运气.如果有一种更简单的方法,它会很棒.

编辑:哦,顺便说一句,我知道我可以从fontsquirrel下载各种格式,但我说的是从这里的官方回购下载.

webfonts google-webfonts

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

Bootstrap JavaScript Carousel不会停止循环

Twitter Bootstrap版本: 2.0.3

示例HTML代码:

<!DOCTYPE html>
<html dir="ltr" lang="en-US" xmlns:og="http://opengraphprotocol.org/schema/">
<head>
<link rel="stylesheet" type="text/css" media="all" href="reddlec/style.css" />
<script type="text/javascript">
$(document).ready(function() {
    $('.carousel').each(function(){
        $(this).carousel({
            pause: true,
            interval: false
        });
    });
});?
</script>
<script src="http://twitter.github.com/bootstrap/assets/js/jquery.js"></script>
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-transition.js"></script>
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-carousel.js"></script>
</head>
<body>
<div id="myCarousel" class="carousel slide">
  <!-- Carousel items -->
  <div class="carousel-inner">
    <div class="active item">…</div>
    <div class="item">…</div>
    <div class="item">…</div>
  </div>
  <!-- Carousel nav -->
  <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
  <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

CSS:bootstrap.css提供

问题:正如您所看到的,我已启用 …

javascript twitter-bootstrap

33
推荐指数
5
解决办法
9万
查看次数

如何"监视"GitHub存储库中的目录?

例如,https://github.com/vanillaforums/Garden是GitHub存储库.但我只想https://github.com/vanillaforums/Garden/tree/master/plugins在存储库中"监视"此目录.

我怎么做?似乎没有办法.

git directory github repository

32
推荐指数
3
解决办法
8547
查看次数

如何为breadcrumb实现schema.org标记?

关于使用schema.org标记实现面包屑的信息不多.到目前为止,我可以得到两份官方文件 - 一份显示:

<div itemscope itemtype="http://schema.org/Property" itemid="http://schema.org/breadcrumb">
   <link itemprop="domain" href="http://schema.org/WebPage"/>
   <link itemprop="range" href="http://schema.org/Text"/>
</div>
Run Code Online (Sandbox Code Playgroud)

而另一个显示这个:

<body itemscope itemtype="http://schema.org/WebPage">
  <div itemprop="breadcrumb">
    <a href="category/books.html">Books</a> >
    <a href="category/books-literature.html">Literature & Fiction</a> >
    <a href="category/books-classics">Classics</a>
  </div>
</body>
Run Code Online (Sandbox Code Playgroud)

这两个加价完全不同.他们对你有意义吗?如果他们这样做,我如何用该标记包含以下简单面包屑代码 - 正确的方法?

<body>
  <span id="breadcrumbs">
      <a rel="home" href="http://example.com">
          <span>Noob Archive</span>
      </a> » 
      <span>
          <a href="http://example.com/topic/html/">
              <span>HTML</span>
          </a> » 
          <strong>Best Practices: Markup for Setting up Breadcrumbs on Web Pages</strong>
      </span>
  </span>
</body>
Run Code Online (Sandbox Code Playgroud)

谢谢!

xhtml breadcrumbs schema.org

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

是否有可能在一个页面上有多个Twitter Bootstrap轮播?

Twitter Bootstrap版本: 2.0.3

示例HTML代码:

<!DOCTYPE html>
<html dir="ltr" lang="en-US" xmlns:og="http://opengraphprotocol.org/schema/">
<head>
<link rel="stylesheet" type="text/css" media="all" href="reddlec/style.css" />
<script type="text/javascript">
$(document).ready(function() {
    $('.carousel').each(function(){
        $(this).carousel({
            pause: true,
            interval: false
        });
    });
});?
</script>
<script src="http://twitter.github.com/bootstrap/assets/js/jquery.js"></script>
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-transition.js"></script>
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-carousel.js"></script>
</head>
<body>
<div id="carousel-1" class="carousel slide">
  <!-- Carousel items -->
  <div class="carousel-inner">
    <div class="active item">…</div>
    <div class="item">…</div>
    <div class="item">…</div>
  </div>
  <!-- Carousel nav -->
  <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
  <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
</div>

<div id="carousel-2" class="carousel slide">
  <!-- Carousel items --> …
Run Code Online (Sandbox Code Playgroud)

html javascript twitter-bootstrap

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

亚马逊Route 53 - 托管区域和查询的含义是什么?

这似乎是一个很基本的问题,那么,它是,但我点点,有点困惑阅读后,亚马逊路线53常见问题,并要检查,如果我是对的.

  • 什么是托管区域?在外行人发言,这是域(数量example.com,domain.com你要与亚马逊路线53右边关联,等等)?

    所以,关于定价,如果我只使用1个域名,我每月只收0.50美元,对吗?

  • 什么是查询?域名解析的次数?即如果有人访问domain.com它,会为页面本身,图像,样式表,JS文件等生成许多查询,对吗?那么,查询的数量大致等于网站及其内容的点击次数?

dns amazon-web-services amazon-route53

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