Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
css/引导-如何防止文本溢出按钮?_Css_Angularjs_Twitter Bootstrap_Twitter Bootstrap 3 - Fatal编程技术网

css/引导-如何防止文本溢出按钮?

css/引导-如何防止文本溢出按钮?,css,angularjs,twitter-bootstrap,twitter-bootstrap-3,Css,Angularjs,Twitter Bootstrap,Twitter Bootstrap 3,我有一个按钮组,我想把文本保存在元素中。我不怎么写CSS,我很想用twitter引导解决这个问题 我的问题是: 按钮大小合适,我只想把文字放在里面 该组是使用angularjs生成的。我希望文本留在父div中 <div class="btn-group-vertical col-md-3"> <div class='btn btn-default' ng-repeat="(route_id, route) in routes"> <h2&g

我有一个按钮组,我想把文本保存在元素中。我不怎么写CSS,我很想用twitter引导解决这个问题

我的问题是:

按钮大小合适,我只想把文字放在里面

该组是使用angularjs生成的。我希望
文本留在父div中

<div class="btn-group-vertical col-md-3">
    <div class='btn btn-default' ng-repeat="(route_id, route) in routes">
        <h2>{{route.short_name}}</h2>
        <p>{{ route.description }}</p>
    </div>
</div>

{{route.short{u name}}
{{route.description}}


在第二个div上使用:-

style=“溢出:隐藏;高度:30px;宽度:30px”

根据需要调整高度和宽度引导类必须超越高度和宽度


如果上述方法无效,请尝试使用style=“clear:tware”

您可以尝试使用
换行:break-word
如果你给出溢出:隐藏,这将对你有所帮助。它会起作用,但会被切掉。在我自己的例子中,我对按钮应用了以下css

style='display: table;white-space: pre-line;word-break: break-all;'

上述
css
规则将使按钮保持响应。因此,将要“溢出”的文本将移动到按钮的下一行

您可以尝试设置
wordwrap:break-word到您的p元素。这样一来,第一行中不合适的单词就转到了它下面的第二行。不起作用。可能是引导覆盖了一些东西,这会删除文本并使其变得丑陋。不要这样,然后使用style=“overflow:hidden;height:30px;width:30px”尝试将height和width的值从30更改为适合它的任何数字