首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >jquery步骤-内容向右浮动

jquery步骤-内容向右浮动
EN

Stack Overflow用户
提问于 2015-08-01 02:56:49
回答 1查看 466关注 0票数 2

我尝试在干净的页面中运行基本示例。默认情况下,我的内容框位于右侧,而不是位于步骤按钮下方:

代码如下:

代码语言:javascript
运行
复制
<html>
<head>
  <title>Demo</title>
  <script src="Scripts/jquery-1.10.2.js"></script>
  <script src="Scripts/jquery.steps.js"></script>
  <link href="Content/jquery.steps.css" rel="stylesheet" />
</head>
<body>
  <div id="wizard">
    <h1>First Step</h1>
    <div>First Content</div>

   <h1>Second Step</h1>
   <div>Second Content</div>
  </div>

    <script>
      $("#wizard").steps();
  </script>
</body>
</html>

在外部内容div上设置了一个溢出,但是当我在使用一个非常简单的向导遇到问题时,我不太愿意深入研究这个问题。我希望文档中遗漏了必需的容器。

EN

回答 1

Stack Overflow用户

发布于 2015-08-01 03:30:10

我想通了。代码应用了一个clearfix类,但作者打算让您提供自己的类,或者忽略了将其包含在css中。我最终从他在github中的演示"main.css“中删除了它:

代码语言:javascript
运行
复制
/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.clearfix:after {
    clear: both;
}

/*
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */

.clearfix {
    *zoom: 1;
}

https://raw.githubusercontent.com/rstaib/jquery-steps/master/demo/css/main.css

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31753260

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档