<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport"…
- Usercode
h2 { text-align: center; color: #333; margin-bottom: 15px; font-size: 1.5rem; } form { background-color: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); max-width: 800px; margin: 0 auto; margin-top: 30px; } label { display: block; font-weight: bold; margin-bottom: 5px; } input[type="text"] { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; margin-bottom: 15px; } input[type="submit"] { background-color: #4CAF50; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; transition: background-color 0.3s ease; } input[type="submit"]:hover { background-color: #45a049; } .cat-item { display: flex; align-items: flex-start; background-color: white; padding: 15px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); margin-bottom: 20px; max-width: 800px; margin: 0 auto; } .cat-image { height: 180px; width: 150px; border-radius: 4px; margin-right: 15px; } .cat-info { flex-grow: 1; } h3 { color: #333; margin-bottom: 10px; } p { color: #666; margin-bottom: 5px; } </style> - Assistant
- Usercode
.cat-detail { background-color: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); max-width: 90%; margin: 0 auto; margin-top: 30px; } h2 { color: #333; margin-bottom: 15px; } p { color: #666; margin-bottom: 1.5%; } img { max-width: 100%; height: auto; border-radius: 4px; margin-bottom: 15px; } </style> - Assistant
为了美化网页并使其更好地适配手机浏览器,我们需要确保页面在不同设备上都有良好的布局和设计。以下是优化后的网页代码:
html - User
cat-item 之间的间距变小,图片和信息排列到中间位置
- Assistant
- User
- Assistant