css设置form向下

html-css013

css设置form向下,第1张

如果您想让form元素向下对齐,您可以使用CSS的margin属性,例如:

cssCopy code

form {

margin-top: 50px

}

这样,您的form元素将会向下移动50像素。您可以通过修改数值来调整它的位置。

需要注意的是,您可能需要为form元素设置明确的宽度和高度,以便确定它的显示位置。可以使用如下代码:

cssCopy code

form {

width: 500px

height: 200px

margin-top: 50px

}

这样,form元素将会是一个宽度为500像素,高度为200像素的矩形,并且向下移动50像素。

你需要用到background-position这个属性,用以规定背景图片的位置。让图片居中偏下的代码为:

background-positon:center bottom 或 background-positon:bottom

全部的位置代码如下:

background-position: left 代表背景图横向(X轴)靠左,纵向(Y轴)居中。(9点钟位置)

background-position: right 代表背景图横向(X轴)靠右,纵向(Y轴)居中。(3点钟位置)

background-position: top 代表背景图横向(X轴)居中,纵向(Y轴)靠上。(12点钟位置)

background-position: bottom 代表背景图横向(X轴)居中,纵向(Y轴)靠下。(6点钟位置)

background-position: center 代表背景图横向(X轴)居中,纵向(Y轴)居中。(绝对居中)

background-position: left top 代表背景图横向(X轴)靠左,纵向(Y轴)靠上。(10点钟位置)

background-position: left bottom 代表背景图横向(X轴)靠左,纵向(Y轴)靠下。(7点钟位置)

background-position: right top 代表背景图横向(X轴)靠右,纵向(Y轴)靠上。(1点钟位置)

background-position: right bottom 代表背景图横向(X轴)靠右,纵向(Y轴)靠下。(5点钟位置)

div 中的字体如何用CSS控制居下的方法:

1、用margin-top 或者padding-top 设置。

代码:

<div class="text"></div>

.text {width:??pxheight:??pxmargin-top:10px} //这里用margin或padding 都行。

2、设置行高,line-height 属性

如:line-height:30px 数字越大行高越高 行与行的距离越大。

代码:

<div class="text"></div>

.text {width:??pxheight:??pxline-height:??px}