php - HTML元素的CSS调整
问题描述
我需要帮助来调整带有 css 的某个 html 元素<div class="content">
,以便它可以像这样(https://i.imgur.com/vYsIUXy.jpg)在该位置固定和响应,无论屏幕尺寸如何,而不像这样(https: //i.imgur.com/qUHHI0q.jpg)。
#info #head>.content
我将from的宽度更改为100%
to82%
但在较小的屏幕尺寸上它与封面图像重叠。
HTML 代码
片段
<div id="head">
<div class="content">
<div class="uigrid">
<div class="contingo">
<p style="font-size:30px;">Meng Qi Shi Shen</p>
<div class="horizontal-list">
<a href="/anime-list" class="item">Adventure</a>
<a href="/anime-list" class="item">Comedy</a>
<a href="/anime-list" class="item">Drama</a>
<a href="/anime-list" class="item">Historical</a>
<a href="/anime-list" class="item">Romance</a>
<a href="/anime-list" class="item">Shoujo</a>
<div class="type"><span class="sub" onclick="if (!window.__cfRLUnblockHandlers) return false; changegrid()">Sub</span><span class="dub" onclick="if (!window.__cfRLUnblockHandlers) return false; changegrid()">Dub</span></div> </div>
</div>
</div>
</div>
<div class="overlay"></div>
</div>
完整的 php(html) 代码
https://codeshare.io/arj6eA
CSS 代码
https://codeshare.io/GbyP86
解决方案
您可以尝试使用设备的最大宽度来调整您想要的。例如,如果 decive 宽度为 600ps
@media (max-width: 600px) {
#info #head:after {
content: '';
position: absolute;
bottom: 0;
width: 82%;
height: 3px;
box-shadow: 0 2px #1b1c1d;
}
}
或者当设备宽度为 1000px 时喜欢这个
@media (max-width: 1000px) {
#info #head:after {
content: '';
position: absolute;
bottom: 0;
width: 75%;
height: 3px;
box-shadow: 0 2px #1b1c1d;
}
}
有关更多信息,请在此处查看https://www.w3schools.com/css/css_templates.asp
推荐阅读
- flutter - 分享更新后flutter显示错误的偏好包
- python - python kivy Boxlayout没有组织它的孩子
- r - 如何使用超赋值“<<-”通过记忆递归函数清除“备忘录”或更好地理解 R 中的范围
- java - 从java类获取项目目录
- javascript - 何时需要在 Javascript 中的函数外部声明变量?
- sql - SQL Hive - MD5 哈希
- javascript - 使用 keyup.arrowDown 和 keyup.arrowUp 导航列表
- api - 资源名称/创建 [POST] 与资源名称 [POST] 之间的 API 端点 URL 差异
- node.js - 开发flutter app时手机调用node api
- php - 有没有办法像 array_combine 那样组合两个以上的数组?