CSS怎么設(shè)置計算器
CSS(級聯(lián)樣式表)是一種用于描述HTML文檔樣式的語言,它可以用來設(shè)置計算器的樣式,下面是一些CSS代碼示例,用于設(shè)置計算器的外觀和布局:
1、設(shè)置計算器背景顏色:
```css
body {
background-color: #f0f0f0;
}
```
2、設(shè)置計算器字體:
```css
body {
font-family: Arial, sans-serif;
font-size: 16px;
}
```
3、設(shè)置計算器按鈕樣式:
```css
button {
background-color: #007BFF;
color: #FFFFFF;
border: none;
padding: 10px 20px;
margin: 5px;
cursor: pointer;
}
```
4、設(shè)置計算器按鈕的懸停效果:
```css
button:hover {
background-color: #0056b3;
}
```
5、設(shè)置計算器按鈕的焦點效果:
```css
button:focus {
outline: 0;
box-shadow: 0 0 3px #007BFF;
}
```
6、設(shè)置計算器按鈕的禁用效果:
```css
button:disabled {
background-color: #cccccc;
color: #333333;
}
```
7、設(shè)置計算器整體布局:
```css
calculator {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 300px;
width: 200px;
border: 1px solid #007BFF;
border-radius: 5px;
box-shadow: 0 0 10px #007BFF;
}
```
8、設(shè)置計算器內(nèi)部布局:
```css
calculator > div {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 40px;
border-bottom: 1px solid #007BFF;
}
```
9、設(shè)置計算器輸入字段樣式:
```css
input[type="text"] {
width: 100%;
height: 30px;
border: 1px solid #007BFF;
border-radius: 5px;
padding: 5px;
}
```