我有以下 CSS 网格:
.grid-3x4 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr 1fr;
grid-template-areas:
'a b c '
'd e f'
'g h i'
'l m n';
}
Run Code Online (Sandbox Code Playgroud)
尽管模板区域的内容,我希望网格具有 100vh 的固定高度。我试图插入:
max-height : 100vh;
Run Code Online (Sandbox Code Playgroud)
到 .grid-3x4 类,但不起作用。我还尝试将网格包装在另一个类中,在包含类上设置最大高度,但没有运气。我怎样才能做到这一点?
我正在尝试为 Hubspot 构建自定义表单和提交帖子。
我有以下代码
HTML
<head>
<script src="prezzi-form-submit.js"></script>
</head>
<body>
<form class='form-inline' id='my-custom-form'>
<div class="form-group">
<input type='email' class='form-control' placeholder='Your email address' required>
</div>
<button class="btn btn-primary" type='submit'>Sign up</button>
</form>
<!-- Actual form that gets submitted to HubSpot -->
<div class="hidden" id='hubspot-form'>
<script charset="utf-8" src="//js.hsforms.net/forms/current.js"></script>
<script>
hbspt.forms.create({
portalId: 'my-portal-id',
formId: '92b9b82a-0da2-4e23-8a30-04541c05ce6d',
onFormReady: function($form) {
$form.attr('target', 'hubspot-iframe');
}
});
</script>
<!-- iFrame that data will get submitted to. This hack stops the page redirect. -->
<iframe name="hubspot-iframe" id="hubspot-iframe" sandbox="allow-forms"></iframe>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
JS …
我在CSS里面有这个@media查询:
@media screen and (max-width: 767px) {
/* some styles*/
} /*end @media 767s*/
Run Code Online (Sandbox Code Playgroud)
当我手动调整页面大小时,它会在达到767px断点时切换到响应式布局.
但是,当我从Chrome的下拉列表中选择任何设备布局时
即使设备的宽度小于767px断点,也会加载默认页面而不是媒体查询.我究竟做错了什么?