【发布时间】:2014-07-13 13:09:24
【问题描述】:
我想使用滚动窗格水平滚动到预测。
我已经更新了我的文件,并将其以 bootstrap_and_customization.css 的名称保存在我的 css 文件夹中:
@import 'bootstrap';
@import url(http://fonts.googleapis.com/css?family=Lato:400,700);
#Forecast ul {
float: left;
width: 100%;
padding: 0;
margin: 0;
list-style-type: none;
white-space: nowrap;
}
#Forecast ul li div {
float: left;
text-decoration: none;
color: white;
background-color: purple;
padding: 0.2em 0.6em;
border-right: 1px solid white;
white-space: nowrap;
}
#Forecast ul li a:hover {
background-color: fuchsia;
}
#Forecast ul li {
display: inline;
/*width: 6em;*/
white-space: nowrap;
}
.border {
border: 1px solid #00ced1;
}
我已经将white-space: nowrap; 属性添加到我的元素和代码本身:
<asp:Panel ID="pForecast" ScrollBars="Horizontal" runat="server">
<div id="Forecast" class="nowrap">
<ul class="nowrap">
<li class="nowrap"><a>current</a></li>
<li class="nowrap"><a>1h later</a></li>
<li class="nowrap"><a>2h later</a></li>
<li class="nowrap"><a>tomorrow</a></li>
<li class="nowrap"><a>tomorrow and later</a></li>
<li class="nowrap"><a>even later</a></li>
</ul>
</div>
</asp:Panel>
class="nowrap" 的标记:
.nowrap {
white-space: nowrap;
}
当我运行代码时,它看起来像这样:
我也在使用 bootsrap 框架和很多其他样式。是否可以为我的 div Forecast 重置它们并且只使用我定义的样式?
感谢您的帮助!
【问题讨论】:
标签: html css asp.net twitter-bootstrap scrollpane