标签: margins

我的侧边栏将整个网站推下

所以我得到了这个网站,其中所有内容都完美排列,页眉、正文页脚等。上周我尝试添加侧边栏,但我意识到它把我的主要内容推低了。很多问题是,如何使侧边栏的边距/高度独立于主要内容?(下面贴出CSS代码)

演示:编辑: http: //oldtimesdaily.tumblr.com/ 我的 tumblr 代码。现在看起来怎么样。绝对位置起作用了,主要内容又回到了顶部。但现在我的侧边栏的所有内容都挤在一起,我想绝对定位会删除所有边距?我应该使用什么来将不同的内容放置在侧边栏上?

#quote { /*style for quote division*/
    position:relative;
    width:375px;
    height:70px;
    border:1px solid black;
    font-family:sans-serif;
    font-size:95%;
    padding:3px;
    background-color:lightyellow;
}
#auth { /*style for quote author, if any*/
    position:absolute;
    bottom:3px;
    right:10px;
}
#sidebar {           /*editable*/
    background: url('http://s10.postimg.org/uag5u79d1/vline.png') repeat-y left center;
    background-color: white;
    width: 260px;
    position: relative;
    top: 700px;
    left: 55%;
}
#sidebar .sTitle {
    padding: 0 0 10px 0;
    position: relative;
    margin: 0px 20px 0px;
    color: #222;
    font-size: 15px;
    line-height: 1;
    font-family: QuicksandBold, Helvetica, Arial, sans-serif; …
Run Code Online (Sandbox Code Playgroud)

html css sidebar margins

2
推荐指数
1
解决办法
2535
查看次数

在 Android 中测量“fitCenter”imageView 的边距

给定一个简单的RelativeLayout,如下所示:

    <RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#0fffff">
    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:adjustViewBounds="true"
        android:scaleType="fitCenter"
        android:src="@drawable/img001" />
    </RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

布局边框和图像边框之间的左/上间距取决于在 imageView 中加载的图像的宽/高比。

在此处输入图片说明

在此布局中显示图像后,我如何(以编程方式)知道实际边距(青色区域的宽度和高度)?

android margins imageview android-layout

2
推荐指数
1
解决办法
908
查看次数

为什么添加溢出:隐藏使子元素的边距起作用?

当我添加像h1with这样的元素时margin: 30px 0;,边距会超出容器!

我以前多次遇到这个问题,我通过使用解决了它 overflow: hidden

我想弄清楚是什么问题以及为什么这个解决方案有效?

在这里找到一个 JSFiddle https://jsfiddle.net/LeoAref/zv6c2c2d/

.container {
  background: #ccc;
}
.container.overflow {
  overflow: hidden;
}
.secTitle {
  margin: 30px 0;
}
code {
  color: blue;
}
Run Code Online (Sandbox Code Playgroud)
<!-- secTitle margin goes outside the container -->
<div class="container">
  <h1 class="secTitle">Container without <code>overflow: hidden</code></h1>
</div>

<!-- works fine here -->
<div class="container overflow">
  <h1 class="secTitle">Container with <code>overflow: hidden</code></h1>
</div>
Run Code Online (Sandbox Code Playgroud)

html css margin margins overflow

2
推荐指数
1
解决办法
1092
查看次数

How to exclude the total row (margins) from styling (subset) in a pandas pivot table

I have a .pivot_table with margins = True.

I want to run .style.bar and .style.background_gradient on it but the problem is that margins (column totals) are also formatted and set to the maximum value so it looks non-descriptive.

I had a few ideas on how to solve this, however, none are working so far:

  1. Tried somehow excluding last row (the margins / total columns) from .style using subset, but failed.
  2. Saving the last row in a separate data frame. Removing …

python formatting pivot-table margins pandas

2
推荐指数
1
解决办法
1185
查看次数

为相对布局android创建和设置边缘编程

嗨,我正在开发Android应用程序,其中我正在创建相对布局编程并尝试设置边距并将其添加到具有方向线性的线性布局.所以这是我的代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/screen_background"
    tools:context=".ChooseChannelsFragment" >

    <LinearLayout 
      android:id="@+id/main_outer_llt"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="horizontal"
      >

  </LinearLayout> 

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

在内部片段我正在添加这样的相对布局

RelativeLayout relativeLayout = new RelativeLayout(getActivity());
    RelativeLayout.LayoutParams relativeParams = new RelativeLayout.LayoutParams(200, 80);
    relativeParams.setMargins(20, 20, 20, 20);
    relativeLayout.setLayoutParams(relativeParams);
    relativeLayout.setBackgroundColor(getResources().getColor(R.color.green_color));
    linearLayout.addView(relativeLayout);
Run Code Online (Sandbox Code Playgroud)

它使用给定的颜色和大小创建布局,但不接受边距.难道我做错了什么?这该怎么做?需要帮忙.谢谢.

android margins relativelayout

1
推荐指数
1
解决办法
9877
查看次数

margin-bottom不适用于div

有人可以帮我弄清楚为什么我的移动视图媒体查询中的边距底部规则不起作用?

我甚至添加了一个类来清除命名的浮点数,.clearer但这也没有用.我想要的只是左侧图像在移动视图上的下方有30px的边距.

这是页面... http://www.haveaseatrentals.com/seat-yourself/

来自移动视图的媒体查询的CSS规则以及我用来清除浮动的规则......

#seatYourselfLeft {margin-bottom: 30px; }
.clearer{clear:both; width:100%; height:0; display: block;}
Run Code Online (Sandbox Code Playgroud)

任何帮助是极大的赞赏.

html css margins floating

1
推荐指数
1
解决办法
8284
查看次数

Stata中一个边缘图中的几个边距的图表

我想margins在一个边缘图中绘制由命令产生的边距,但是来自不同的margins估计.重要限制:这些系数在相同的最小值和最大值内,因此具有可比性.我怎么做?

这是一个代码示例:

webuse nhanes2, clear

tnbreg psu weight hdresult iron, iterate(5) // I am using this regression type so I stick with it here
Run Code Online (Sandbox Code Playgroud)

我知道我可以将所有边距响应图放在一个图中

margins, dydx(*)
marginsplot, horizontal xline(0) yscale(reverse) recast(scatter)
Run Code Online (Sandbox Code Playgroud)

但实际上我分别margins为每个回归量运行三个命令,因为我想比较回归量变化时的效果.因此代码是

foreach var in weight hdresult iron {
  * Procedure to get the numbers for margins right
  quietly summarize `var '
  local max = r(max)
  local step = round(r(max)/6)

  quietly margins, at(`cvar'=(1(`step')`max'))
  marginsplot, title("") ytitle("")
}
Run Code Online (Sandbox Code Playgroud)

这给了我三个单独的文件.但我当然希望所有的线都在一个图中,用不同的颜色.

有什么建议怎么做?

plot margins stata

1
推荐指数
1
解决办法
1万
查看次数

如何使用NReco.PdfGenerator设置边距?

我成功地使用NReco.PDFGenerator更改了许多设置,但我不明白如何设置边距.我找到了一个.Margins选项,但它想要的类型PageMargins.以下是我尝试过的一些事情.如何设置上边距,左边距,下边距和右边距?

HtmlToPdfConverter pdfConverter = new HtmlToPdfConverter();
pdfConverter.Size = PageSize.Letter;
pdfConverter.Orientation = PageOrientation.Landscape;
pdfConverter.Zoom = 1F;
pdfConverter.CustomWkHtmlArgs = "--encoding UTF-8";

// What I tried...
pdfConverter.Margins = (PageMargins)1;    // can't caste
pdfConverter.Margins = PageMargins.????;  // no appropriate methods
pdfConverter.Margins = 1;                 // wrong type
pdfConverter.Margins = "1";               // wrong type
Run Code Online (Sandbox Code Playgroud)

asp.net pdf-generation margins c#-4.0

1
推荐指数
1
解决办法
4122
查看次数

复制R中的Stata边距

我有一个回归模型,其中一组指标变量与回归量相互作用.在这种情况下,P值可以很好地用于模型选择.我知道Stata有一个叫做的命令margins,在这种情况下它确实有用.例:

margins, dydx(*)
Run Code Online (Sandbox Code Playgroud)

来自相关的Stata手册

描述

边距是根据先前拟合模型的预测计算的统计数据,其在一些协变量的固定值处并且对剩余的协变量进行平均或以其他方式积分.该margins命令估计协变量的指定值的响应边距,并将结果显示为表格.能力包括估计边际均值,最小二乘均值,平均和条件边际和部分效应(可以作为衍生物或弹性报告),平均和条件调整预测以及预测边际.

R中有没有类似的功能?

replication regression r margins stata

1
推荐指数
1
解决办法
631
查看次数

Flutter NestedScrollView / SliverAppBar-不需要的底边距

要使用导航抽屉构建应用栏:

@override
  Widget build(BuildContext context) {
    var drawerOptions = <Widget>[];
    for (var i = 0; i < widget.drawerItems.length; i++) {
      var d = widget.drawerItems[i];
      drawerOptions.add(new ListTile(
        leading: new Icon(d.icon),
        title: new Text(d.title),
        selected: i == _selectedDrawerIndex,
        onTap: () => _onSelectItem(i),
      ));
    }
    drawerOptions.add(
        new RaisedButton(onPressed: () => {}, child: new Text("Ustawienia")));

    return new Scaffold(
        body: NestedScrollView(
          headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
            return <Widget>[
              SliverAppBar(
                expandedHeight: 130.0,
                floating: false,
                pinned: true,
                flexibleSpace: FlexibleSpaceBar(
                  title:
                      new Text(widget.drawerItems[_selectedDrawerIndex].title),
                ),
              ),
            ];
          }, …
Run Code Online (Sandbox Code Playgroud)

margins dart android-collapsingtoolbarlayout flutter

1
推荐指数
2
解决办法
1945
查看次数