邊框的設定

<!DOCTYPE html>html

<html>ide

<head>佈局

<meta charset="utf-8">post

<title>表單佈局</title>spa

<style>orm

body{htm

margin:0px;utf-8

padding:0px;input

}it

#bj{


margin:0px auto;

background:linear-gradient(to top,#fff 20%, #0077ff 99%);

width:800px;

height:900px;

font-size:50px;

text-align:center;

border-radius:0%;

color:white;

}

#ps{

width: 300px;

height: 40px;

border-width:5px;

border-color:purple;

border-style:double;

border-radius:10px;

}

#tx{

border-width:5px;

border-color:purple;

border-style:double;

width: 300px;

height: 40px;

border-radius:10px;

}

#yx{

border-width:5px;

border-color:purple;

border-style:double;

width: 300px;

height: 40px;

border-radius:10px;

}

#dy{

background:#0077ff;

color:#ffffff;

font-family:"楷體";

font-size:20px;

width: 90px;

height: 40px;

border-width:5px;

border-color:purple;

border-style:double;

border-radius:10px;

position:absolute;

left:600px;

top:300px;

}

#bq{

position:absolute;

top:0px;

left:140px;

}

</style>

</head>

<body>

<div id="bj">

用戶登陸

<form action" method="post" accept-charset="utf-8">

<label for="ps"></label><input id="ps" type="text" name="password" value="" placeholder="請輸入姓名"><br>

<input id="tx" type="text" name="tx" value="" placeholder="請輸入郵箱"><br>

<input id="yx" type="password" name="yx" value="" placeholder="請輸入密碼"><br>

<input id="dy" type="submit" name="su" value="登陸">

</form>

<div id="bq">

<a href="index.html"><input id="dy" type="submit" name="su" value="註冊"></a>

</div>

</div>

</body>

</html>

CSS 邊框

  在 HTML 中,咱們使用表格來建立文本週圍的邊框,可是經過使用 CSS 邊框屬性,咱們能夠建立出效果出色的邊框,而且能夠應用於任何元素。

  元素外邊距內就是元素的的邊框 (border)。元素的邊框就是圍繞元素內容和內邊據的一條或多條線。每一個邊框有 3 個方面:寬度、樣式,以及顏色。

  CSS 規範指出,邊框繪製在「元素的背景之上」。這很重要,由於有些邊框是「間斷的」(例如,點線邊框或虛線框),元素的背景應當出如今邊框的可見部分之間。

  樣式是邊框最重要的一個方面,這不是由於樣式控制着邊框的顯示(固然,樣式確實控制着邊框的顯示),而是由於若是沒有樣式,將根本沒有邊框;CSS 的 border-style 屬性定義了 10 個不一樣的非 inherit 樣式,包括 none

  您能夠經過 border-width 屬性爲邊框指定寬度。

  爲邊框指定寬度有兩種方法:能夠指定長度值,好比 2px 或 0.1em;或者使用 3 個關鍵字之一,它們分別是 thin 、medium(默認值) 和 thick

  position屬性分爲相對移動和絕對移動,相對移動表示爲relative,絕對移動爲absolute。相對是指相對本身原來的位置移動;絕對是相對與父級移動,若是父級元素沒有position屬性就相對於body移動

相關文章
相關標籤/搜索