html - 如何更改我的标题和边框块在小屏幕和大屏幕上的响应
问题描述
我有一个带有边框块的标题,但它不占用整个宽度,如果我在更大的屏幕上打开我的网站,它没有响应,尺寸一切都改变了我该如何改变这个?
这就是它在普通笔记本电脑屏幕上的外观。
笔记本电脑屏幕:
<div class="header">
<div class="info">
<h1>Welcome to TaxiWorld</h1>
<div class="borderPics">
<div class="meta">
<br>
<a href="https://twitter.com/nodws" target="_b" class="author"></a>
<img src="LogoBenchMark.png" alt="Girl in a jacket" style="height: 54px; width:54px;">
<hr align="left" width="75%"><br>
</div>
<div class="meta">
<br>
<a href="https://twitter.com/nodws" target="_b" class="author"></a>
<img src="LogoBenchMark.png" alt="Girl in a jacket" style="height: 54px; width:54px;">
<hr align="left" width="75%"><br>
</div>
<div class="meta">
<br>
<a href="https://twitter.com/nodws" target="_b" class="author"></a>
<img src="LogoBenchMark.png" alt="Girl in a jacket" style="height: 54px; width:54px;";>
<hr align="left" width="75%"><br>
</div>
</div>
</div>
我需要在我的 css 中更改什么,以便我在两个屏幕中都有相同的屏幕。
.borderPics{
border-style: solid;
border-width: medium;
background-color:rgba(0,0,0,0.35);
border-color:transparent;
padding: 1.25rem 0;
padding-bottom: 0;
}
.author{
display:inline-block;
width:50px;
height:50px;
border-radius:10%;
background:url(car.jpg) center no-repeat;
background-size:cover;
box-shadow:0 2px 3px rgba(0,0,0,0.3);
margin-bottom:3px
}
.header:before{
content:"";
width:100%;
height:100%;
position:absolute;
top:0;
left:0;
-webkit-backface-visibility: hidden;
-webkit-transform: translateZ(0) scale(1.0, 1.0);
transform: translateZ(0);
background:#1B2030 url(taxi.jpg) top center no-repeat;
background-size:cover;
background-attachment:fixed;
animation: grow 60s linear 10ms infinite;
transition:all 0.2s ease-in-out;
z-index:-2
}
解决方案
为此,使用
@media only screen and (min-width:1024px) {
//neccessary CSS for normal screen
}
推荐阅读
- git - 在我的新分支上运行 `git merge` 出现问题
- python - 使用 Python 抓取网页而不加载整个页面
- typescript - 如果类型定义已经在 package.json 中,为什么我必须在 tsconfig.json 中指定类型
- php - 通过在运行 SQL 查询时显示错误来将内部联接与组一起使用
- swift - 在 FocusState 中传递泛型 Hashable
- reactjs - 在 useMutation 中使用“refetchQueries”时,“OnCompleted”对 useQuery 不起作用,如何解决?
- r - 我应该在 dplyr 中使用 select("column_name") 还是 select(column_name)?
- android - Android Studio 上两个项目的不同 git 版本
- xml - XSL 列表反向
- c - 检查 scanf 输入