HTML <br> 标签的 clear 属性

<br clear="right/left/all" /> 

仅支持right、left、all三个值,并且只有在左对齐或右对齐的图像或表格起作用。
效果:
一:不使用clear属性

<img src="image.png" align="left">
<br/>2021年<br/>新年快乐

在这里插入图片描述
二:使用clear属性定义为left, 直接清除左边界

<img src="image.png" align="left">
<br/>2021年<br clear="left"/>新年快乐

在这里插入图片描述
注:可以发现使用了<br clear="left" />清除了左边界,所以新年快乐这行字不受图片影响直接在图片下面显示了

``` <%@ page language="java" import="test_package.*" import="java.util.*" import="java.sql.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <link rel = "stylesheet" href = "../style/account_set.css"> </head> <body> <% List<test_information> list=new ArrayList<>(); try{ Class.forName("com.mysql.cj.jdbc.Driver"); String url="jdbc:mysql://localhost:3306/washcustomer"; String username="root"; String password="zqz20011222."; Connection c =DriverManager.getConnection(url,username,password); Statement s=c.createStatement(); String sql="select * from clothes"; ResultSet rs= s.executeQuery(sql); while(rs.next()) { String expected_time; if(rs.getString("expected_time").compareTo("点击选择时间")==0) { expected_time="未选择时间"; } else { expected_time=rs.getString("expected_time"); } test_information clothes=new test_information(rs.getString("material"),rs.getString("owner_tel"),rs.getString("start_time"),expected_time,rs.getInt("price"),rs.getString("washing_method"),rs.getString("clothes_state"),rs.getString("bill_state"),rs.getString("number")); list.add(clothes); } } catch(SQLException e) { e.printStackTrace(); System.out.println("操作失败"); } %> <tit >当前账套</tit> <input type = "button" value = "添加账套" onclick = "add_account.show()" class = "add_a"> <table border=1 class="t"> <tr> <th class = "name">单位名称</th><th class = "id">纳税人识别号</th><th class = "func">操作</th><th class = "func">删除</th></tr> <%for(test_information news:list) {%> <tr> <th class = "name"><%=news.getMaterial() %></th> <th class = "id"><%=news.getTel() %></th> <th class = "func"><form action = ""><input value = "<%=news.getTel() %>" type = "hidden"><input class="op" type = "submit" value ="进入账套"></form></th> <th class = "func"><form action = ""><input value = "<%=news.getTel() %>" type = "hidden"><input class = "op" type = "submit" value ="删除账套"></form></th> </tr> <%} %> </table> <dialog id ="add_account"> <form action = "" > <h1 class = "add_tit">添加账套</h1><br> <h1 class = "t1">单位名称</h1><input type = "text" class = "information" name = "name"><br> <h1 class = "t1">纳税人识别号</h1><input type = "text" class = "information" name = "id"><br> <h1 class = "t1">行业</h1><input type = "text" class = "information" name = "industry"><br> <h1 class = "t1">增值税种类</h1><select class = "select" name = "type"><option>小规模纳税人</option><option>一般纳税人</option></select><br> <h1 class = "t1">审核凭证</h1><select class = "select" name = "check"><option>审核</option><option>不审核</option></select><br> <input type = "submit" value = "新增账套"> <input type = "button" value = "清空" id = "clear"> <input type = "button" value = "返回" onclick = "add_account.close()"> </form> </dialog> <script> document.getElementById("clear").addEventListener("click", function () { var inputs = document.getElementsByClassName("information"); for (let i = 0; i < inputs.length; i++) { inputs[i].value = ""; // 文本框清空 } let selects = document.getElementsByTagName('select'); for(let j=0;j<selects.length ;j++){ selects[j].selectedIndex =0; // 恢复下拉列表至初始状态 } }); </script> </body> </html>```为什么遮罩出现后原本应该出现的弹窗也没了
最新发布
03-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值