responsive-design 相关问题

响应式网页设计(RWD)是一种Web设计和开发方法,旨在制作网站,以便根据屏幕大小,平台和方向在各种设备上提供最佳体验。

使用 object-fit: cover 将绝对定位的元素保持在背景图像的相同部分,无论宽高比如何

我想将“固定”元素绝对定位在背景图像上方。无论宽高比如何,它们都必须位于图像内容的完全相同部分之上。图像有对象...

回答 1 投票 0

有人可以帮我确定三星a10的宽度/高度吗

我正在尝试找出三星 a10 手机的视口,以用于我的网站的响应式设计。现在它提到分辨率为 720 x 1520 像素,对于手机尺寸来说这无疑太大了......

回答 1 投票 0

如何让子级沿着父级div调整大小,同时保持比例?

如何使子元素沿着父元素流畅地调整大小,同时保持比例? 正如您在附加的视频文件宽高比中看到的那样:1/0 有效,但是当您将鼠标悬停在 HTML 元素上时...

回答 1 投票 0

响应式图像在移动浏览器中无法正确加载

我有一个包含标题图像的网站。 然而,当我在 iOS 上的 Firefox 或 Safari 中加载网站时,这些标题图像一开始似乎没有加载。这是一个屏幕截图: 这是...的代码

回答 1 投票 0

在浏览器中放大页面

当我运行 VScode 实时服务器时,整个页面太大,并且我没有响应式网页,但在 DevTools 中它工作得很好。 这就是页面在我的屏幕上的样子 这就是它在

回答 2 投票 0

如何用纯JS和CSS创建一个带触摸的无限轮播? [已关闭]

这是一个使用普通 JS 和 CSS 进行触摸的无限多项目图像轮播的示例。 没有依赖项,没有框架。

回答 1 投票 0

如何创建无限多项目图像轮播? (+ Touch 和所有 Plain Vanilla JS 和 CSS)[关闭]

如果不使用 jQuery 等外部库或 Angular 等框架,就能拥有一个具有无限效果的图片库,那就太棒了。一个普通的 JS 和 CSS,所以每个人都可以使用。 怎么办?

回答 1 投票 0

响应式 CSS:将列始终彼此相邻定位

在桌面上有 4 列彼此相邻,在平板电脑上只有 2 列彼此相邻。 不知何故,这两列不会按照应有的方式对齐。 我总共使用了 12 列。 col-x 代表

回答 1 投票 0

我的 React 应用程序中跨浏览器的不同视图

我的网站在 Chrome 移动视图中与在实际手机上的 Safari 视图中看起来不同。 我已经为所有样式使用了前缀(WebKit,...) 我还使用 normalize.css 来解决任何问题 我需要帮助

回答 1 投票 0

如何让我的页脚在所有设备上直接响应(没有任何文字突破底线)?

我想知道是否有更好的方法可以使此页脚在所有设备上以直线响应(没有任何单词打破线条),而不必经常使用媒体查询 我是

回答 1 投票 0

如何使响应式页脚在所有设备上水平显示?

我想知道是否有更好的方法让这个响应式页脚保持水平位置(没有任何换行符),而不需要如此频繁地使用媒体查询 这是代码和

回答 1 投票 0

我正在尝试使CSS中的边框底部响应,所以当我放大时,它不会变得超级厚[重复]

正如标题所述,我正在努力使我的 CSS 响应式。我有一个边框底部:实心 0.5rem 白色; 代码行,我想知道是否有替代的尺寸选项来制作边框-

回答 1 投票 0

Bootstrap 5 图像响应能力

1 我正在使用 Bootstrap 5 创建一个网站,在我的功能和任务部分中,我希望当视口为移动设备或平板电脑大小时图像移动到文本上方,但我不知道如何做

回答 1 投票 0

CSS 将 Px 单位转换为 Rem/Em?

在了解 rem/em 单位之前,我使用 px 对整个网站进行编码,因此响应速度不是很好。 有没有办法将 px 转换为 rem/em 单位,以便更改我的网站会更快更容易?

回答 2 投票 0

手机上响应宽度太小,但在桌面浏览器上还可以

我正在练习响应式网页设计。从我到目前为止所了解到的情况来看,它围绕着带有流体组件的流体网格和 CSS 媒体查询。 该网站看起来就像我想要的样子

回答 1 投票 0

当我调整屏幕大小时,CSS 媒体不起作用

你的文字我正在用这个设计练习网格。 当我为设计创建@media时,CSS不会从宽度全屏更改为手机屏幕。 我确实插入了“ your text我正在用这个设计练习网格。 当我为设计创建@media时,CSS不会从宽度全屏更改为手机屏幕。 我确实插入了“ ” 这是我的html代码: <div class="appdiv"> <p class="apptx">Download <br>Our App</p> <p><br>Order your favorite food from your phone!!<br> To make ordering more comfortable and faster for you<br> we’ve created our personal application. <br>Now you can make orders from any device and whereever you are.</p> <div class="phdiv"> <a href="https://apps.apple.com/us/app/mazza-more/id1159500430" target="_blank"><img class="logoimg" src="./image/iosapp.png"></a> <a href="https://play.google.com/store/apps/details?id=hr.apps.n279798" target="_blank"><img class="logoimg" src="./image/google-play-download-android-app-logo-png-transparent (1).png"></a></div> <img class="appph" src="./image/showph.png"> </div> 这是我的CSS代码: @media screen and (max-width: 790px) { .appdiv { display: grid; grid-template-columns: auto; grid-template-rows: 120px 50px 20px 120px; width: 100%; height: 50vh; text-align: center; } .appph { height: 200px; width: 150px; } } p { font: 1.2rem bold; } .left { text-align: left; line-height: 1.8; } img { margin-right: 35px; } .bhours { margin: 25px; } .time { line-height: 1.4; } .logoimg { height: 40px; width: 120px; } .phdiv { text-align: center; display: inline-block; margin-top: 150px; } .appdiv { display: grid; grid-template-columns: auto auto; grid-template-rows: 120px 50px 20px; background-color: white; width: 100%; height: 50vh; text-align: center; margin-top: 50px; margin-left: auto; margin-right: auto; } .appph { height: 400px; width: 350px; grid-area: 1/2/4/3; } .apptx { margin: 50px; text-align: center; font: 1.8rem bolder; } 问题在于 CSS 规则的顺序:由于常规规则遵循媒体查询之后,因此它们会覆盖它们(它们对所有尺寸都有效)。 为了避免这种情况,请将整个 @media... { ... } 部分移动到样式表的*末尾*。

回答 1 投票 0

网站图像容器的响应能力

我正在使用 Bootstrap 5 创建一个网站,在我的功能和任务部分中,我希望当视口为移动设备或平板电脑大小时图像移动到文本上方,但我不确定如何适应...

回答 1 投票 0

我希望图像位于 4 列中,但它落入 bootstrap 5 中的其他列中,并且我尝试了 img-responsive img-fluid 但它不起作用

定义的 4 个图像:其中三个图像位于 1 行,但第 4 个图像不断落入另一行 我尝试使用 margin o mx-0 或 px-0 但它只会减少其边距而不是其网格 ...

回答 1 投票 0

我希望这个jquery给我以%而不是像素为单位的位置

这是我现在所拥有的。这给了我以像素为单位的绝对位置 $(这个).css({ “左”:($(this).width() + 5) * (索引 % 4), “顶部”:($(this).height() + 5) * Math.floor(index / 4)...

回答 3 投票 0

如何让这个布局响应式?

我正在根据该图像编写布局。 到目前为止我所得到的都在这个代码笔中。 HTML: 我正在根据这张图片编写布局。 到目前为止我所得到的都在这个codepen中。 HTML: <div class="root-wrapper"> <div class="sidebar"> <div id="logo"> <img src="https://www.logodesign.net/logo/line-art-house-roof-and-buildings-4485ld.png?size=2" width="250" /> </div> <nav class="nav flex-column"> <a class="nav-link" href="#"> Dashboard </a> </nav> </div> <div class="content d-block d-xxl-flex"> <div class="main"> Content </div> <div class="aside d-none d-xxl-block"> </div> </div> </div> CSS: body { background: linear-gradient(75deg, #e2ceff 0%, #e9eaff 100%); } .root-wrapper { margin: 3% 5%; padding: 10px 10px 10px 0; background-color: #5955b3; border-radius: 3rem; display: flex; flex-direction: row; overflow: hidden; .content { border-radius: 2.8rem; background-color: #fff; flex-grow: 7; display: flex; flex-direction: row; overflow: hidden; min-height: 800px; .main { flex-grow: 6; padding: 2.7rem 2rem; // font-size: 1.25rem; .page-description { padding: 1rem 0; } // h1 { // color: #5955b3; // font-weight: 900; // font-size: 2.5rem; // } .card { h2 { color: #303030; font-weight: 800; } &.card-1 { background-color: #f4f4fe; } &.card-2 { background-color: #f7ecfc; } &.card-3 { background-color: #fbecf1; } } .card-footer { padding: 1.7rem 1rem; } } .aside { flex-grow: 4; background-color: #f9f8fd; min-width: 150px; max-width: 150px; } } .sidebar { flex-grow: 1; min-width: 300px; max-width: 300px; width: 100%; #logo { text-align: center; margin: 1rem 0 2rem 0; } nav { font-size: 1.12rem; gap: 1rem; .nav-link { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 1.5rem; color: #c6d3fa; // #adacd8; font-weight: 800; border-left: 6px solid transparent; &:hover { color: #e4cda4; } &.active { border-color: #fdf2d8; color: #fdf2d8; } &.disabled { color: #6b8aca; } } } } } 我的目标是使该模板以以下方式响应:徽标、徽标下的内容、内容下侧边栏的其余部分。问题是我必须在移动布局中“拆分”侧边栏才能完成此操作,但我不知道该怎么做。 我该如何实现这一点? 您可以通过使用网格来实现您的目标。 首先,您需要将 display: grid 设置为 .root-wrapper 并使用媒体查询根据分辨率更改 grid-template-areas 样式。 您还需要将 grid-area 设置为 .logo、.nav、.content 元素。 您可以在我的CodePen上查看运行结果。 为了您的方便,我还附上了代码。 HTML <div class="root-wrapper"> <div id="logo"> <img src="https://www.logodesign.net/logo/line-art-house-roof-and-buildings-4485ld.png?size=2" width="250" /> </div> <nav class="nav flex-column"> <a class="nav-link" href="#"> Dashboard </a> </nav> <div class="content d-block d-xxl-flex"> <div class="main">Content</div> <div class="aside d-none d-xxl-block"></div> </div> </div> SCSS body { background: linear-gradient(75deg, #e2ceff 0%, #e9eaff 100%); } .root-wrapper { margin: 3% 5%; padding: 10px; background-color: #5955b3; border-radius: 3rem; display: grid; grid-template-areas: "logo" "content" "nav"; @media only screen and (min-width: 600px) { grid-template-areas: "logo content" "nav content"; grid-template-rows: auto 1fr; grid-template-columns: 300px 1fr; padding-left: 0px; } .content { grid-area: content; border-radius: 2.8rem; background-color: #fff; flex-grow: 7; display: flex; flex-direction: row; overflow: hidden; min-height: 800px; .main { flex-grow: 6; padding: 2.7rem 2rem; // font-size: 1.25rem; .page-description { padding: 1rem 0; } .card { h2 { color: #303030; font-weight: 800; } &.card-1 { background-color: #f4f4fe; } &.card-2 { background-color: #f7ecfc; } &.card-3 { background-color: #fbecf1; } } .card-footer { padding: 1.7rem 1rem; } } .aside { flex-grow: 4; background-color: #f9f8fd; min-width: 150px; max-width: 150px; } } #logo { grid-area: logo; text-align: center; margin: 1rem 0 2rem 0; } nav { grid-area: nav; font-size: 1.12rem; gap: 1rem; .nav-link { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 1.5rem; color: #c6d3fa; // #adacd8; font-weight: 800; border-left: 6px solid transparent; &:hover { color: #e4cda4; } &.active { border-color: #fdf2d8; color: #fdf2d8; } &.disabled { color: #6b8aca; } } } }

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.