我遇到的问题是内容超出容器.它发生在我的代码的service_description区域.我有垂直和水平填充设置描述.垂直填充不是水平的.
要使描述出来只需单击其中一个框,然后您将看到我所指的内容.我希望所有内容都保留在该框中.
当我有填充集时,为什么这样做呢?
$('.service_wrapper').click(function() {
var thisDescription = $('.service_description', $(this));
$('.service_description').not(thisDescription).hide().parent().removeClass('closed');
thisDescription.slideToggle(500).parent().toggleClass('closed');
});
.page_wrap {
margin: 15px 10%
}
.left_service_wrap {
float: left;
width: 40%;
margin-left: 5%;
}
.service_wrapper {
margin-left: 25%;
border: 1px solid black;
margin: 15px 0;
width: 80%;
}
.service_list {
margin-left: 20%;
}
.service_title {
padding: 15px 12px;
margin: 0;
font-weight: bold;
font-size: 1em;
}
.service_title:before {
content: '';
background: url('http://i.stack.imgur.com/GC7i2.png') 0 0 / 10px 10px no-repeat;
width: 10px;
height: 10px;
display: inline-block;
vertical-align: middle;
padding-right: 6px;
}
.closed .service_title:before {
background-image: url('http://i.stack.imgur.com/ma4L4.png');
}
.service_title:hover {
background-color: gray;
color: blue;
cursor: pointer;
}
.service_description {
display: none;
padding: 8px 14px;
width: 100%;
margin-top: 10px;
font-size: .9em;
}
Flooring
The best floors! gggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
Roofing
Your roof will be perfect! gggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
1> sbeliv01..:
您可以添加word-wrap
到您的.service_description
类中,当它到达容器的末尾时,应该将单词分成新行.
.service_description {
display: none;
padding: 8px 14px;
width: 100%; /* Probably should remove this as well */
margin-top: 10px;
font-size: .9em;
word-wrap: break-word;
}
推荐阅读
-
如何解决《服务工作者额外打电话》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《如何将lodash更新到最新版本》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《如何在AndroidStudio中使用Jacoco生成androidTest的代码覆盖率报告》经验,为你挑选了0个好方法。 ...
[详细]
-
如何解决《使用css模块做反应如何将className作为prop传递给组件》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《什么是返回List<string>元素的微优化和最优雅方式,这些元素仅在其他List<string>中出现一次》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《在flexbox布局中设置图像基线》经验,为你挑选了0个好方法。 ...
[详细]
-
如何解决《卡夫卡有重复的消息》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《当一个人说电脑"挂起"或冻结时会发生什么?》经验,为你挑选了0个好方法。 ...
[详细]
-
如何解决《无法从http端点消耗》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《Patsy:测试数据中分类字段的新级别》经验,为你挑选了0个好方法。 ...
[详细]
-
如何解决《在R中添加MinRow》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《VBA变量声明在两行上没问题但在逗号分隔时没有.编译错误?》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《无法在Windows的Xampp中安装OAuth扩展》经验,为你挑选了0个好方法。 ...
[详细]
-
如何解决《打印json对象中的所有路径》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《Windows10AppStore提交所需的映像是什么?》经验,为你挑选了0个好方法。 ...
[详细]
-
如何解决《ReactNative:使用AtomIDE》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《redux-form-通过代码设置字段的值?》经验,为你挑选了1个好方法。 ...
[详细]
-
如何解决《由于com.sun.javafx.css.StyleManagerloadStylesheetUnPrivileged,JavaFx无法加载@font-face字体》经验,为你挑选了0个好方法。 ...
[详细]
-
吐了个 "CAO" !
Tags | 热门标签
RankList | 热门文章
-
1TFS将两个变更集合并到同一分支中
-
2"使用PDO和MS SQL,活动结果不包含任何字段"
-
3我想在div onClick函数中为图像禁用onClick事件?
-
4使用ORDER BY更新
-
5更改文件夹中文件的文件扩展名?
-
6在C++中定义具有相同签名的两个函数
-
7bcrypt和随机生成的盐
-
8NSNetworkManager.ResolveListener消息Android
-
9如何在不弄乱布局的情况下为div添加边框?
-
10为什么我们不能在java中用"this"关键字创建一个对象?
-
11ViewDoesNotExist即使它确实存在
-
12Chrome与这个JS崩溃了
-
13不推荐使用<td>宽度,如何设置一行中单个单元格的宽度?
-
14Java静态变量变为null
-
15将调试视图与Windows服务一起使用
-
16内联类构造函数,以避免vc内存崩溃
-
17如何处理两个重叠的Twitter Bootstrap模式
-
18Android:使用服务,对话框等片段的预期用途
-
19Robolectric和Gradle(Android工作室)的Android项目
-
20我想检查std_logic_vector是否包含负整数
DevBox开发工具箱 | 专业的在线开发工具网站 京公网安备 11010802040832号 | 京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有