我希望 UL 将每个项目推到容器的底部。我为该项目设置了 margin-top:auto ,但它不起作用。我有另一个可行的演示,但这是我需要使用的演示。有什么帮助吗?
.featured-products-carousel {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
margin: 0 auto;
max-width: 1150px;
width: 80%;
}
.featured-products-carousel .item {
background-color: white;
padding: 20px;
align-items: stretch;
display: flex;
flex-direction: column;
margin: 10px;
padding: 0;
flex: 1 1 auto;
flex-wrap: wrap;
}
.featured-products-carousel .item h2 {
text-align: center;
padding: 8px 5px;
}
.featured-products-carousel .item .featured-product-description {
margin-bottom: auto;
}
.featured-products-carousel .item .featured-products-links {
margin-top: auto;
}
.featured-products-carousel .item ul {
margin-top: auto;
}
Run Code Online (Sandbox Code Playgroud)
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div …
Run Code Online (Sandbox Code Playgroud)我正在尝试使用grid.arrange()
和 来编译四个图表,以减少每个图的边距,以便它们美观且紧凑。我想使用theme(plot.margin=unit(c(x, x, x , x), "cm"))
(欢迎其他解决方案)。
不久前有人问过类似的问题: here
但是,现在需要没有默认值的plot.margin
参数。units
我找不到任何关于 R 在这个论证中期望什么的解释。有人能举个例子吗?
如需可重现的示例,请使用旧问题中提供的示例。谢谢!
我正在设置箱线图以在 ggplot2 中呈现这些内容facet_grid
,并且我想增加内部边距。
不幸的是,我无法增加到面框的距离。
如何增加蓝色箭头所示的内边距(左和右)?
require(ggplot2)
dat <- rbind(data.frame(approach=1,product=1,value=seq(1,20,0.5)),
data.frame(approach=1,product=2,value=seq(5,15,0.3)),
data.frame(approach=1,product=3,value=seq(5,17,0.2)),
data.frame(approach=2,product=1,value=seq(1,13,0.3)),
data.frame(approach=2,product=2,value=seq(3,18,0.5)),
data.frame(approach=2,product=3,value=seq(4,25,0.7)),
data.frame(approach=3,product=1,value=seq(1,15,0.6)),
data.frame(approach=3,product=2,value=seq(3,16,0.5)),
data.frame(approach=3,product=3,value=seq(1,10,0.1)))
gg1 <- ggplot(dat, aes(group =product, y = value)) +
geom_boxplot() +
ylab("size (cm)")+
theme(panel.spacing = unit(0.1, 'lines')) +
theme(plot.background = element_rect(fill ="lightgrey" )) +
scale_fill_grey(start = 0.0, end = 1) +
theme_bw()+
xlab("") +
facet_grid(cols=vars(approach)) +
theme(axis.text.x = element_text(colour="black")) +
theme(axis.text.y=element_text(colour="black"))+
theme(panel.spacing=unit(0,"lines")) +
guides(fill=guide_legend(title="Products")) +
theme(plot.background = element_rect(fill ="lightgrey" ))
gg1
Run Code Online (Sandbox Code Playgroud)
另外,它对于离散尺度如何工作?
require(ggplot2)
dat <- rbind(data.frame(approach=1,product=1,value=seq(1,20,0.5)),
data.frame(approach=1,product=2,value=seq(5,15,0.3)),
data.frame(approach=1,product=3,value=seq(5,17,0.2)),
data.frame(approach=2,product=1,value=seq(1,13,0.3)),
data.frame(approach=2,product=2,value=seq(3,18,0.5)),
data.frame(approach=2,product=3,value=seq(4,25,0.7)), …
Run Code Online (Sandbox Code Playgroud) 我需要一些关于如何使用边距以及填充如何工作的信息.
例如:我应该用一条线来占据页面的整个宽度(无论用什么分辨率来显示网页),只让每边都有一个小边框,我怎么能实现这个呢?
我有以下HTML
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<style>
.box
{
border:solid black 1px;
padding:0px;
margin:0px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<input class="box" style="width:300px;" /><br />
<input class="box" style="width:150px;" />
<input class="box" style="width:150px;" /><br />
<input class="box" style="width:100px;" />
<input class="box" style="width:100px;" />
<input class="box" style="width:100px;" />
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这个想法是文本框应该在右侧完成像素完美.
我最终会在第2行和第3行添加间距以扩大宽度以进行补偿,但目前我想要渲染这个简单的样本.
那么如何删除这些文本框的边距以使对齐正确呢?
我有一个UILabel,如果我调整文本的大小,我可以让它看起来是一个UITextView但是左边距是不同的,在UIlabel上文本正好对着UITextView略有边缘的左边框.如何调整UILabel,以便当这些控件放在彼此之上时,它们看起来一致?
我有一个如下所示的数据框:
Flag1 Flag2 Type1 Type2 Type3
1 A FIRST 2 0 0
2 A SECOND 1 9 0
3 A THIRD 3 7 0
4 A FOURTH 9 18 0
5 A FIFTH 1 22 0
6 A SIXTH 1 13 0
7 B FIRST 0 0 0
8 B SECOND 3 9 0
9 B THIRD 5 85 0
10 B FOURTH 4 96 0
11 B FIFTH 3 40 0
12 B SIXTH 0 17 0
Run Code Online (Sandbox Code Playgroud)
我需要总结一下,我的数据框最终看起来像这样
Flag1 …
Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我使用方法setMargins(....)来查看某些视图.
在我的布局中,我使用'dp'修正了我的视图的宽度,高度和大小,而不是像素,
在我的代码中,当我设置边距时,它会产生不好的结果,但是当我在布局中使用px更改dp时,这样可以正常工作.
所以我的问题是:我可以用dp值设置边距,?? 例如:
myView.setMargins(left in dp , top in dp , right in dp , bottom in dp ) ;
Run Code Online (Sandbox Code Playgroud)
提前致谢
首先,这里是我的应用程序目前的链接:ds http://i50.tinypic.com/30skom0.jpg
在显示的两个图表中,我想摆脱条形图左边的边距.有任何想法吗?
以下是我的渲染器设置.我搜索过,无法找到有类似问题的人.看起来应该很简单......
private void drawBarChart(XYMultipleSeriesDataset dataset) {
int marginT = 10;
int marginL = 5;
int marginB = 10;
int marginR = 5;
int[] margins = {marginT, marginL, marginB, marginR};
...
XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
renderer.setOrientation(Orientation.VERTICAL);
renderer.getSeriesRendererAt(0).setDisplayChartValues(false);
renderer.getSeriesRendererAt(1).setDisplayChartValues(false);
renderer.getSeriesRendererAt(2).setDisplayChartValues(false);
renderer.setLabelsColor(Color.LTGRAY);
renderer.setAxesColor(Color.BLACK);
renderer.setYAxisMin(0);
renderer.setMargins(margins);
renderer.setYAxisMax(maxYVal);
renderer.setYLabels(0);
renderer.setXLabels(0);
renderer.setXAxisMin(0);
renderer.setXAxisMax(2);
renderer.setZoomEnabled(false,false);
renderer.setPanEnabled(false, false);
renderer.setBarSpacing(-0.5);
renderer.setShowAxes(false);
renderer.setShowLabels(false);
renderer.setShowLegend(false);
...
display chart in view
}
protected XYMultipleSeriesRenderer buildBarRenderer(int[] colors) {
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
int length = colors.length;
for (int …
Run Code Online (Sandbox Code Playgroud) 我正在使用ui bootstrap for angular(使用twitter bootstrap css).我能够使标签居中,但我无法弄清楚如何在标签之间添加间距(边距)(右或左).我尝试添加margin-right:100px; 在.nav-tabs> li但是没有用.
HTML:
<html>
<body>
<tabbed-Panel class="bottomTabPanel">
<!--<div data-fade="1" ngModel="activeTab" bs-Tabs>-->
<tabs>
<pane ng-repeat="pane in panes" heading="{{pane.title}}" active="pane.active">
<div ng-include src="activeContent()"></div>
</pane>
</tabs>
<!--</div>-->
</tabbed-Panel>
</div
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
CSS
.bottomTabPanel{
position:absolute;
bottom:-12px;
display:block;
background-color:#666666;
padding-left: 75px;
padding-right: 75px;
}
/*Bottom tab panel style: */
.nav-tabs>li>a {
height:73px;
width: 131px;
border: 1px solid transparent;
-webkit-border-radius: 0px 0px 0 0;
-moz-border-radius: 0px 0px 0 0;
border-radius: 0px 0px 0 0;
color: #5261ac;
font-size: 19px;
font-weight:bold;
background-color:#c2c8e4; …
Run Code Online (Sandbox Code Playgroud) margins ×10
css ×3
html ×3
r ×3
android ×2
ggplot2 ×2
achartengine ×1
android-ui ×1
bar-chart ×1
dataframe ×1
facet-grid ×1
flexbox ×1
iphone ×1
layout ×1
padding ×1
tabs ×1
textbox ×1
uilabel ×1
uitextfield ×1