Hbuilder中box-shadow
时间: 2023-11-18 15:46:26 浏览: 40
在 HBuilder 中,可以使用 CSS 属性 `box-shadow` 来添加阴影效果。其语法如下:
```css
box-shadow: h-shadow v-shadow blur spread color inset;
```
其中各个值的含义如下:
- `h-shadow`:必需,水平阴影的位置,可以是负值;
- `v-shadow`:必需,垂直阴影的位置,可以是负值;
- `blur`:可选,模糊的距离;
- `spread`:可选,阴影的尺寸;
- `color`:可选,阴影的颜色;
- `inset`:可选,将阴影改为内阴影。
例如,以下代码会创建一个具有深灰色外阴影和浅灰色内阴影的矩形:
```css
box-shadow: 2px 2px 5px #888888, -2px -2px 5px #FFFFFF inset;
```
其中,`2px 2px 5px #888888` 表示右下角的外阴影,`-2px -2px 5px #FFFFFF inset` 表示左上角的内阴影。
相关问题
hbuilder简单登录界面代码
以下是一个简单的 HBuilder 登录界面的代码示例:
HTML 代码:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Login Page</title>
<link rel="stylesheet" href="css/login.css">
</head>
<body>
<div class="login-wrapper">
<h1>Login Form</h1>
<form action="#" method="post">
<label for="username">Username</label>
<input type="text" id="username" name="username" placeholder="Enter your username">
<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="Enter your password">
<button type="submit">Login</button>
</form>
</div>
</body>
</html>
```
CSS 代码:
```css
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
.login-wrapper {
background-color: #fff;
margin: 50px auto;
padding: 20px;
width: 400px;
border-radius: 5px;
box-shadow: 0px 0px 10px #ccc;
}
h1 {
text-align: center;
margin-bottom: 20px;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 5px;
}
input[type="text"], input[type="password"] {
padding: 10px;
margin-bottom: 10px;
border-radius: 5px;
border: none;
box-shadow: 0px 0px 5px #ccc;
}
button[type="submit"] {
padding: 10px;
background-color: #4CAF50;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
box-shadow: 0px 0px 5px #ccc;
}
button[type="submit"]:hover {
background-color: #3e8e41;
}
```
此代码可以生成一个简单的登录表单,包含用户名、密码和登录按钮。您可以根据需要进行修改和样式设置。
hbuilder登录页面代码
以下是一个简单的HBuilder登录页面代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Login</title>
<style type="text/css">
body {
background-color: #f0f0f0;
}
form {
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
width: 300px;
margin: 100px auto;
}
label {
display: block;
margin-bottom: 10px;
}
input[type="text"], input[type="password"] {
padding: 5px;
border-radius: 5px;
border: 1px solid #ccc;
width: 100%;
box-sizing: border-box;
}
input[type="submit"] {
background-color: #2ecc71;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
margin-top: 10px;
}
input[type="submit"]:hover {
background-color: #27ae60;
}
</style>
</head>
<body>
<form>
<h2>Login</h2>
<label>Username:</label>
<input type="text" name="username">
<label>Password:</label>
<input type="password" name="password">
<input type="submit" value="Login">
</form>
</body>
</html>
```
该示例将生成一个具有基本样式和输入字段的登录表单。您可以通过在HBuilder中创建一个新的HTML文件并将代码复制粘贴到其中来使用此示例。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)