Html 媒体查询不会调整字段集和按钮的大小
我正在尝试使用媒体查询,但我有一个问题。当我调整窗口大小时,它不会做任何事情。当我调整窗口大小时,我尝试使用不同的选项,例如: 我有这个:Html 媒体查询不会调整字段集和按钮的大小,html,css,jsp,resize,media-queries,Html,Css,Jsp,Resize,Media Queries,我正在尝试使用媒体查询,但我有一个问题。当我调整窗口大小时,它不会做任何事情。当我调整窗口大小时,我尝试使用不同的选项,例如: 我有这个: @media all and (max-width: 900px) { #breakdown-search-clear-button { margin-left: 28% !important; } #historico-incidencias{ width: 36.1% !important; margin-left
@media all and (max-width: 900px) {
#breakdown-search-clear-button {
margin-left: 28% !important;
}
#historico-incidencias{
width: 36.1% !important;
margin-left: 62% !important;
margin-top: -27.8% !important;
}
}
还是这个
@media screen and (max-width: 900px) {
#breakdown-search-clear-button {
margin-left: 28% !important;
}
#historico-incidencias{
width: 36.1% !important;
margin-left: 62% !important;
margin-top: -27.8% !important;
}
}
在我的css文件的末尾。但它不起作用。我先尝试使用“@media screen”,然后尝试使用“@media all”,但当我调整窗口大小时,这两种情况都不起作用
然后我尝试在我的.jso文件上添加标记,如本例所示:
我写这个标签:
<meta name="viewport" content="width=device-width, initial-scale=1">
在标签的末尾,我写下:
<style>
/* On screens that are 600px wide or less, the background color is olive */
@media screen and (max-width: 900px) {
#breakdown-search-clear-button {
margin-left: 28% !important;
}
#historico-incidencias{
width: 36.1% !important;
margin-left: 62% !important;
margin-top: -27.8% !important;
}
}
</style>
/*在600px或更小宽度的屏幕上,背景色为橄榄色*/
@媒体屏幕和(最大宽度:900px){
#故障搜索清除按钮{
左边距:28%!重要;
}
#历史事件{
宽度:36.1%!重要;
左边距:62%!重要;
利润率最高:-27.8%!重要;
}
}
但是,当我像css文件一样调整窗口大小时,它没有任何作用
HTML元素:
<div id="breakdown-search-clear-button" class="roundedButtonMin roundedButtonRight deleteBG" style="margin-left: 24% !important; margin-top: 1% !important;"></div>
<fieldset style="width: 46.1%; margin-left: 52%; margin-top: -23%; display: inline-block; vertical-align: top;" id="historico-incidencias">
<legend>Histórico</legend>
<div id="listHistoricalIncidences"></div>
</fieldset>
希斯托里科
有人能帮我吗
谢谢大家! 分享你的html会很好:)我不能分享所有的html文件,但我添加了我想调整大小的html元素在你的情况下,我认为窗口调整大小后会发生什么是问题,我不知道你想实现什么,但查询正在工作我想调整表的大小和更改按钮位置,但它没有做任何事情