我希望我在这里提供了足够的细节.

我目前正试图在Labjs上设计一个实验,我想知道是否有一种方法可以让网站对屏幕大小做出更好的响应,使用的是超文本标记语言(HTML)还是css?我的意思是,我可以使用CSS/HTML根据用户屏幕的大小来调整刺激的大小吗?

我当前的CSS代码是这样的:

/* Please define your custom styles here */


cons_left {
  margin-left: 10%;
  margin-right: 10%;
} 

.pickparent {
  position: relative;
  top: 0;
  left: 0;
 // border: 3px solid black;
} 

.pickpicker {
  position: relative;
  top: 0;
  left: 0;
//  border: 3px solid red;
} 

.pickimage {
  filter: grayscale(100%);
  position: absolute;
  margin: auto;
  z-index: 2;
 // border: 3px solid red;
} 

#location_percentage, #color_percentage {
  font-size: 70px;
  text-align: center;
  display: block;
  margin: 0 auto;
}

.feedback, .percentage {
  font-size: 70px;
  text-align: center;
}

.feedback {
  font-size: 70px;
  margin-top: 450px;
  display: block;
  line-height: 70px;
}

.feedback:first-line {
  font-size: 70px;
  margin-top: 100px;
  display: block;
  line-height: 120px;
}

.percentage {
  margin-top: 20px;
  margin-bottom: 20px;
}

#next-button {
    display: none;
    align-items: center;
  }

.message {
  font-size: 50px;
  text-align: center;
  position: absolute
  margin: 20%
}

我曾try 更改css的各种属性以使其具有响应性,但到目前为止还没有成功.我还try 实现了一个zoom 任务,用户必须将矩形的大小调整为卡片的大小,但我在这里也找不到解决方案.

谢谢你的帮助!

推荐答案

您可以使用媒体查询来确定站点的响应屏幕大小.

@media only screen and (max-width: 
600px) {
  body {
   background-color: lightblue;
  }
}

你可以在这里了解更多信息: W3schools media queries

Html相关问答推荐

为什么在Vuettify 3中使用Flex时会忽略宽度?

Xpath:提取标签之间的文本,但一旦出现嵌入标签就停止

如何找到FontAwese图标的Unicode值?

如何在一行文本溢出省略号后显示文本?

页脚与主要内容重叠

Tailwind CSS:overflow-y Property Not Scrolling Unreliably to Bottom with top-[63px]

子元素的单一背景

平移变换下的SVG剪辑路径行为

渐变进度条位置

带有图标和悬停过渡的CSS按钮

HTML中的ARIA标签:在元素内部还是外部?(&Q;

如何使单选按钮在被 Select /选中时看起来像这样的设计?

为什么溢出时overflow: auto框的底部有一个小间隙?

Django 如何从文件系统下载文件?

我如何使用 html 在表格的单元格内实现下面显示的背景 colored颜色 加载器(请判断设计参考的图像链接)

为什么我的 div 元素没有形成一个圆形时钟?

如何从 razor 页面打开 html 页面

Primeng浮动标签溢出管理

无法使用 Reactjs 多次更新本地存储

如何在锚点可点击的伪元素周围制作空白?