Ví dụ thời gian thực. Chúng được sử dụng trong lĩnh vực ngân hàng, tất cả các trang web của chính phủ, trang web của công ty cá nhân và các trang web liên quan đến quân đội như hải quân, không quân, v.v.
cú pháp
Bắt đầu khóa học phát triển phần mềm miễn phí của bạn
Phát triển web, ngôn ngữ lập trình, kiểm thử phần mềm và những thứ khác
Selector
{ //Open curly brace
Property: Value;
} //closed curly brace
Thí dụ
h2
{ //h2 is a selector
padding: 2px 2px 2px 2px; //padding is property
// 2px 2px 2px 2px are values to property
border: none; //border is property
// none is value to property
margin: 2px 2px 2px 2px; //margin is property
// 2px 2px 2px 2px are values to property
width: 80% //width is property
// 80% is value to property
}
Biểu mẫu đăng nhập CSS hoạt động như thế nào?
- Điều này sẽ hoạt động bằng cách thêm các tệp CSS rõ ràng như CssFileName. css bên trong tập lệnh HTML
- We can add the explicit css file as “”.
cú pháp
.
.
.
- Chúng tôi cũng có thể viết thông tin đăng nhập CSS tương tự bên trong tệp HTML.
- Inserting these 2 style tags inside the tag to write CSS logic inside the HTML file.
cú pháp
//CSS logic
.
.
.
ví dụ
- Tạo biểu mẫu đăng nhập. Mẫu đăng nhập. html
button {
background-color: brown; /*sets the button background color as brown*/
padding: 12px 18px; /*sets the button padding as 12px and 18px */
width: 100%; /*sets the button width 100%*/
margin: 6px 0;/*sets the margin 6px and 0px*/
border: none;/*sets the button border is none*/
}
input[type=text], input[type=password] {/*sets the user name and password fields styles*/
padding: 11px 17px; /*sets the user name and password padding as 11px and 18px */
width: 100%;/*sets the user name and password width as 100% */
display: inline-block; /*sets the user name and password display as block color*/
margin: 6px 0;/*sets the user name and password margin as 6px and 0px*/
border: 2px solid red;/*sets the user name and password border with 2px, solid border and red color border*/
box-sizing: border-box; /*sets the user name and password fields as box shape*/
}
span.passwordField {/*sets the password field style*/
padding-top: 16px;/*sets the password field top padding as 16px*/
float: right;/*sets the password field fixed to right*/
}
.mainBody {
padding: 14px; /*sets the total body padding as 14px*/
}
Login Form for EDUCBA
User Name :
Password :
Login
đầu ra
Password?