javascript - 是否可以在窗口大小更改时自动更改组元素的大小?

标签 javascript html css

这是我的布局示例:

enter image description here

有可能有一个固定大小的元素,然后当窗口大小改变时,元素也会改变它的大小(以及所有的填充、边距和东西)。

最后,有没有办法限制元素组的大小?

最佳答案

is there a way to set a limit on how small the group of elements can be?

min-width css 属性正是您所需要的。

It is possible to have a fixed size elements and then when the window size changes, the elements also changes its size (and also all the paddings, margins and stuff).

percentage 值可以帮助您实现该功能。

The CSS data type represents a percentage value. It is often used to define a size as relative to an element's parent object. Numerous properties can use percentages, such as width, height, margin, padding, and font-size. MDN

关于javascript - 是否可以在窗口大小更改时自动更改组元素的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52473238/

相关文章:

javascript - 更改轮播导航点击上的背景图像

javascript - Math.random 会重复吗?

javascript - 使用 HTML5 本地存储

html - 将 Div 向上移动 20px - 但保留边框

html - ul li 在 div 左侧对齐和对齐

html - 如何使用css格式化下面的文本

javascript - Node.js/JavaScript 内置类型的 stub ?

javascript - 更改 Javascript 数组内的对象值

html - 目标 "_blank"未打开新窗口

html - 显示与浏览器不同的简单电子邮件 CSS