将作者放在左下角播放量和点赞数放在右下角!DOCTYPE htmlhtmlhead meta charset=UTF-8 title查询中心title meta name=viewport content=width=device-width initial-scale=10 maximum-scale=10 user-scalable=0script src=httpscode
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>查询中心</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
margin: 0;
padding: 0;
}
<pre><code> h1 {
color: #333333;
text-align: center;
padding: 20px;
background-color: #ffffff;
margin: 0;
}
form {
max-width: 600px;
margin: 20px auto;
background-color: #ffffff;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
label {
display: block;
margin-bottom: 10px;
font-weight: bold;
}
input[type="text"],
textarea {
width: 100%;
padding: 10px;
font-size: 16px;
border: 1px solid #cccccc;
border-radius: 4px;
}
input[type="submit"] {
background-color: #333333;
color: #ffffff;
padding: 10px 20px;
font-size: 16px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #555555;
}
.result {
max-width: 600px;
margin: 20px auto;
background-color: #ffffff;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
}
.result h3 {
margin-bottom: 10px;
}
.result p {
margin-bottom: 5px;
}
.result .author {
align-self: flex-end;
}
.result .metrics {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
</style>
<script>
$(document).ready(function() {
$("#searchInput").on("input", function() {
var searchValue = $(this).val();
$.ajax({
type: "POST",
url: "search.php", // 修改为您的搜索处理页面
data: { search: searchValue },
success: function(response) {
$(".result").remove(); // 清除之前的搜索结果
$(".searchResult").append(response); // 添加新的搜索结果
}
});
});
});
</script>
</code></pre>
</head>
<body>
<h1>查询中心</h1>
<div>
<form id="searchForm" method="post">
<input type="text" name="search" id="searchInput" value="" placeholder="">
</form>
<?php foreach ($arr as $key=>$value) { ?>
<div class="result">
<h3><?php echo $value['wenzhang_name'];?></h3>
<div class="author">作者: <?php echo $user_info['user_name'];?></div>
<p><?php echo $value['wenzhang_miaoshu'];?></p>
<div class="metrics">
<p>点赞: <?php echo $value['wenzhang_dianzan'];?></p>
<p>浏览: <?php echo $value['wenzhang_view'];?></p>
</div>
</div>
<?php } ?>
</div>
</body>
</html
原文地址: https://www.cveoy.top/t/topic/hVjC 著作权归作者所有。请勿转载和采集!