标签: margins

动态设置图像视图的边距

我可以知道如何动态设置imageview中的边距吗?

android margins android-imageview

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

CSS边距自动不居中浮动元素

我有一个以div元素为中心的问题.我想要居中的div元素应用了以下样式:

width: 60%;
float:right;
margin-left: auto;
margin-right: auto;
min-width: 300px;
Run Code Online (Sandbox Code Playgroud)

唯一的父标记是body标记,它应用了以下样式:

width:100%;
overflow-x:hidden;
Run Code Online (Sandbox Code Playgroud)

元素不是居中,而是与右边对齐.我之前将元素设置为"float:left",并且我没有将它居中的问题,但是当我将其更改为"float:right"时,元素不再居中.

css margins css-float

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

正文和页脚之间的 wkhtmltopdf 边距

我正在使用 wkhtmltopdf 生成一个报告,这个报告包含长度可变的文本,因此我并不总是可以强制分页,有时 wkhtmltopdf 必须为我做。

我试图找出是否有任何方法可以在 wkthtmltopdf (--footer-left foo --footter-right [page]) 引入的页脚和页面正文之间强制留出边距。

我已经尝试过使用 CSS margin-bottom 但它不起作用,因为它应用于 html 的末尾而不是分页。

而且我也尝试过 wkhtmltopdf 边距底部“-B 10mm”但它不起作用,因为它也应用于页脚。

请问有什么线索吗?

提前致谢。

html css margins footer wkhtmltopdf

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

Android以编程方式将边距添加到Webview

我需要以编程方式将边距添加到webview.我想做类似下面的事情:

public void setSideMargin(final int sideMargin, int id) {
    WebView webView = (WebView) ((Activity) context)
            .findViewById(id);

    WebView.LayoutParams p = new WebView.LayoutParams(
            WebView.LayoutParams.MATCH_PARENT,
            WebView.LayoutParams.WRAP_CONTENT);

    p.leftMargin = sideMargin;
    p.rightMargin = sideMargin;

    webView.setLayoutParams(p);
}
Run Code Online (Sandbox Code Playgroud)

我知道这显然是错误的,但有什么我可以做的以编程方式添加边距吗?谢谢

java android margins webview

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

安卓。ConstraintLayout:约束结束不起作用

我需要使用 来创建链ConstraintLayout。我希望将 TextView 附加到左侧,文本后紧跟一个ImageView,另一个ImageView附加到屏幕的右侧。看一个例子。

在此输入图像描述

如果TextView包含长文本,我需要将文本转到另一行。也就是说,TextView不与右侧的图像视图重叠,但仅限于边距。看一个例子。

在此输入图像描述

这是我的代码:

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    tools:ignore="MissingPrefix">

    <TextView
        android:id="@+id/tvTitle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/text"
        android:textColor="@color/black"
        android:textSize="@dimen/text_size_14"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0" />

    <ImageView
        android:id="@+id/ivFirst"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="16dp"
        android:src="@drawable/ic_first"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@id/ivSecond"
        app:layout_constraintHorizontal_bias="0"
        app:layout_constraintStart_toEndOf="@id/tvTitle"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0" />

    <ImageView
        android:id="@+id/ivSecond"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_second"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="1"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0" />
</androidx.constraintlayout.widget.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)

如果文本不长,则一切正常,但如果文本很长,则它会叠加在屏幕上ImageView并超出屏幕。我尝试使用链条但没有任何效果。请帮我。

android margins chain android-layout android-constraintlayout

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

div内的空白空间,不是边距或填充

在div中有一个div和一个图像,所有边距都设置为0 - 但是它一直显示在div内部,甚至不在外侧,它不是填充或边距,我似乎无法弄清楚它是什么.

我试图将Div更改为部分,给它们带来负边距,使高度达到100%但没有任何效果!

以下是该网站的链接:http://www.webdesignstudents.co.uk/students/loai_shehadeh/1/portfolio.html 您可以通过查看页面源查看完整代码,但这里是我使用的HTML是这个:

        <div class="wrapperB">
            <div class="content">
                <div id="portfolio-sectionB" class="all">
                    <div id="grid1"><!--Gird 1-->   

                        <div class="galleryItemB visualIdentity">
                            <img alt="Brighton and Hove In Bloom Logo" src="portfolio/images/brighton-in-bloom-logo-mockup-1.jpg">
                            <a href="portfolio/brighton-in-bloom.html"></a>
                        </div>  

                        <div class="galleryItemB visualIdentity">
                            <img alt="" src="portfolio/images/hovecollege-course-magazine-mockup2.jpg">
                            <a href="portfolio/hovecollege-course-magazine.html"><p>Click To View Project</p></a>
                        </div>  

                        <div class="galleryItemB visualIdentity">
                            <img alt="" src="portfolio/images/brighton-pet-show-poster-mockup3.jpg">
                            <a href="portfolio/brighton-pet-show.html"><p>Click To View Project</p></a>
                        </div>  

                        </div><div id="grid2"><!--Gird 2--> 

                        <div class="galleryItemB visualIdentity">
                            <img alt="" src="portfolio/images/ambition-world-bussiness-card-mockup.jpg">
                            <a href="portfolio/ambition-world.html"><p>Click To View Project</p></a>
                        </div>  

                        </div><div id="grid3"><!--Gird 3--> 

                        <div class="galleryItemB visualIdentity">
                            <img alt="" …
Run Code Online (Sandbox Code Playgroud)

css html5 image margins padding

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

PDF.js中的moznomarginboxes属性是做什么的?

Firefox的内置PDF查看器PDF.jsmoznomarginboxes<html>标签上有一个属性.这个属性有什么作用?

注意:有关PDF.js中HTML标记的其他属性的信息,请参阅PDF.js 中的mozdisallowselectionprint属性有何作用?.

printing firefox margins printing-web-page pdf.js

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

如何在ListView中的第一项添加上边距?

这是一个非常简单的问题.我想在ListView的第一项中添加一个上边距.那可能吗?

android listview margins

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

我无法在 Visual Studio Code 中编写 CSS 边距

我是 Visual Studio Code 的新手,正在学习 html 和 css,我正在学习使用边距,然后我注意到我无法在文件 css 中的 Visual Studio 代码中编写边距。这是我的示例代码:

.headerContainer{
    background-color: red;
    width: 40%
    margin:auto
}
Run Code Online (Sandbox Code Playgroud)

它一直给我错误分号预期的CSS(css-semicolonexpected)

我希望我需要在 Visual Studio Code 中进行一些更改

html css margins syntax-error visual-studio-code

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