div class="Subject_box"> 当前学科:<a ng-bind="NowSubject" class="NowSubject"></a> 课程:<a ng-bind="NowClass" class="NowClass"></a> </a> </a>
时间: 2023-09-28 17:06:16 浏览: 49
这是一个HTML代码片段,表示一个包含学科和课程信息的容器。
该容器使用了class为"Subject_box"的div元素来包裹内容。
在该容器中,包含了以下内容:
- 当前学科的信息,使用了一个带有ng-bind指令的a标签,通过ng-bind指令将学科信息动态绑定到a标签的内容中。同时,该a标签也具有class为"NowSubject"的样式类。
- 课程的信息,同样使用了带有ng-bind指令的a标签,将课程信息动态绑定到a标签的内容中。该a标签也具有class为"NowClass"的样式类。
整体上看,该HTML代码片段表示一个学科和课程信息的容器,通过ng-bind指令将学科和课程信息动态绑定到对应的a标签中。
相关问题
<?php $link=mysqli_connect("localhost","user","123456","database","3307"); $sql="SELECT * FROM xxnews WHERE ID = ".$_POST["ID"]; $rs=mysqli_query($link,$sql); while($rows=mysqli_fetch_array($rs)) { echo "<form action='update.php?uID=".$rows["ID"]."' method='post' target='_blank'>"; echo "<div class='head2'>"; echo "标题:<input type='text' name='title' value='".$rows["title"]."' />"; echo "</div>"; echo "<div class='head3'>"; echo "作者:<input type='text' name='author' value='".$rows["author"]."' /> "; echo "时间:"; date_default_timezone_set('PRC'); echo "<input type='text' name='newsDate' value='".date('Y-m-d', time())."' />"; echo " 来源:<input type='text' name='source' value='".$rows["source"]."' /> <input type='submit' name='tijiao' value='修改新闻' class='tijiao' />"; echo "</div>"; echo "<div class='content'>"; echo "<textarea class='content1' name='content'>"; echo $rows["content"]; echo "</textarea>"; echo "</div>"; echo "</form>"; } ?>优化这段代码
这段代码存在SQL注入漏洞,应该使用参数化查询来避免,例如:
```
$stmt = mysqli_prepare($link, "SELECT * FROM xxnews WHERE ID = ?");
mysqli_stmt_bind_param($stmt, "i", $_POST["ID"]);
mysqli_stmt_execute($stmt);
$rs = mysqli_stmt_get_result($stmt);
```
此外,还可以将相同的HTML部分提取出来,避免重复代码,例如:
```
<?php while($rows=mysqli_fetch_array($rs)) { ?>
<form action='update.php?uID=<?php echo $rows["ID"] ?>' method='post' target='_blank'>
<div class='head2'>
标题:<input type='text' name='title' value='<?php echo $rows["title"] ?>' />
</div>
<div class='head3'>
作者:<input type='text' name='author' value='<?php echo $rows["author"] ?>' />
时间: <input type='text' name='newsDate' value='<?php echo date('Y-m-d', time()) ?>' />
来源:<input type='text' name='source' value='<?php echo $rows["source"] ?>' />
<input type='submit' name='tijiao' value='修改新闻' class='tijiao' />
</div>
<div class='content'>
<textarea class='content1' name='content'><?php echo $rows["content"] ?></textarea>
</div>
</form>
<?php } ?>
```
样式优化美化<!DOCTYPE html> {% load static %} <html> <head> <title>个人中心</title> <style> .container { display: flex; flex-wrap: wrap; justify-content: space-between; } .module { width: calc(25% - 20px); margin-bottom: 20px; padding: 20px; border: 1px solid #ccc; border-radius: 5px; } @media (max-width: 768px) { .module { width: calc(50% - 20px); } } @media (max-width: 480px) { .module { width: 100%; } } </style> </head> <body> <div class="container"> <div class="module personal-info"> <!-- 个人信息模块 --> <h2>个人信息</h2> <form> <label for="username">用户名:</label> <input type="text" id="username"> <label for="email">邮箱:</label> <input type="email" id="email"> <button type="submit">保存</button> </form> </div> <div class="module change-password"> <!-- 修改密码模块 --> <h2>修改密码</h2> <form> <label for="old-password">旧密码:</label> <input type="password" id="old-password"> <label for="new-password">新密码:</label> <input type="password" id="new-password"> <label for="confirm-password">确认密码:</label> <input type="password" id="confirm-password"> <button type="submit">保存</button> </form> </div> <div class="module bind-phone"> <!-- 绑定手机模块 --> <h2>绑定手机</h2> <form> <label for="phone">手机号:</label> <input type="tel" id="phone"> <button type="submit">保存</button> </form> </div> <div class="module my-messages"> <!-- 我的消息模块 --> <h2>我的消息</h2> <ul> <li><a href="#">系统消息1</a></li> <li><a href="#">系统消息2</a></li> <li><a href="#">好友消息1</a></li> <li><a href="#">好友消息2</a></li> </ul> </div> </div> </body> </html>
好的,这是优化美化后的代码样式:
<!DOCTYPE html>
{% load static %}
<html>
<head>
<title>个人中心</title>
<style>
.container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.module {
width: calc(25% - 20px);
margin-bottom: 20px;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
@media (max-width: 768px) {
.module {
width: calc(50% - 20px);
}
}
@media (max-width: 480px) {
.module {
width: 100%;
}
}
</style>
</head>
<body>
<div class="container">
<div class="module personal-info">
<!-- 个人信息模块 -->
<h2>个人信息</h2>
<form>
<label for="username">用户名:</label>
<input type="text" id="username">
<label for="email">邮箱:</label>
<input type="email" id="email">
<button type="submit">保存</button>
</form>
</div>
<div class="module change-password">
<!-- 修改密码模块 -->
<h2>修改密码</h2>
<form>
<label for="old-password">旧密码:</label>
<input type="password" id="old-password">
<label for="new-password">新密码:</label>
<input type="password" id="new-password">
<label for="confirm-password">确认密码:</label>
<input type="password" id="confirm-password">
<button type="submit">保存</button>
</form>
</div>
<div class="module bind-phone">
<!-- 绑定手机模块 -->
<h2>绑定手机</h2>
<form>
<label for="phone">手机号:</label>
<input type="tel" id="phone">
<button type="submit">保存</button>
</form>
</div>
<div class="module my-messages">
<!-- 我的消息模块 -->
<h2>我的消息</h2>
<ul>
<li><a href="#">系统消息1</a></li>
<li><a href="#">系统消息2</a></li>
<li><a href="#">好友消息1</a></li>
<li><a href="#">好友消息2</a></li>
</ul>
</div>
</div>
</body>
</html>
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
在如下代码中新增一个验证码表单:<template> <a-typography-title :level="3"> 新特能源还原炉群控平台 </a-typography-title> <a-form class="form mt-16" ref="formRef" :model="formState" :rules="rules" v-bind="layout"> <a-form-item class="form-item" has-feedback name="username"> <a-input class="input" v-model:value="formState.username" type="text" @keyup.enter="onSubmit()" placeholder="请输入用户名" autocomplete="off" allow-clear /> </a-form-item> <a-form-item class="form-item" has-feedback name="password"> <a-input class="input" v-model:value="formState.password" type="password" @keyup.enter="onSubmit()" placeholder="请输入登录密码" autocomplete="off" allow-clear /> </a-form-item> <a-button class="login-button mt-24" type="primary" size="large" block @click="onSubmit()">登录</a-button> </a-form> @2021-2023 中科时代(北京)科技有限公司 版权所有 京ICP备2021032638号-4 </template>
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
const activeIndex=Vue.ref(0);
// console.log(activeIndex.valuea);
function toggleActive(index){
if(activeIndex.value===index){
activeIndex.value=null;
}else{
activeIndex.value=index;
console.log(activeIndex);
console.log(activeIndex.value);
}
const lis =document.querySelectorAll(".clearfix li")
for(let i=0;i{{option.category_title}}
和
{{option2.subtitle}}
{{option2.title}}
{{option2.summary}}
{{option2.subtitle}}
{{option2.title}}
{{option2.summary}}
实现tab切换
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
解释一下这段代码:<template> <a-typography-title :level="3"> 新特能源还原炉群控平台 </a-typography-title> <a-form class="form mt-16" ref="formRef" :model="formState" :rules="rules" v-bind="layout"> <a-form-item class="form-item" has-feedback name="username"> <a-input class="input" v-model:value="formState.username" type="text" @keyup.enter="onSubmit()" placeholder="请输入用户名" autocomplete="off" allow-clear /> </a-form-item> <a-form-item class="form-item" has-feedback name="password"> <a-input class="input" v-model:value="formState.password" type="password" @keyup.enter="onSubmit()" placeholder="请输入登录密码" autocomplete="off" allow-clear /> </a-form-item> <a-button class="login-button mt-24" type="primary" size="large" block @click="onSubmit()">登录</a-button> </a-form> @2021-2023 中科时代(北京)科技有限公司 版权所有 京ICP备2021032638号-4 </template>
![](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)
![](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)