我有以下代码设置一个容器,其高度随浏览器重新调整大小而改变(以保持方形宽高比).
HTML
<div class="responsive-container">
<div class="dummy"></div>
<div class="img-container">
<IMG HERE>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.responsive-container {
position: relative;
width: 100%;
border: 1px solid black;
}
.dummy {
padding-top: 100%; /* forces 1:1 aspect ratio */
}
.img-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
Run Code Online (Sandbox Code Playgroud)
如何在容器内垂直对齐IMG?我的所有图像都有不同的高度,容器不能有固定的高度/线高,因为它的响应...请帮忙!
我知道这background
是速记属性 - 值0
对所有属性有什么影响,它是有效的CSS吗?
selector {background:0;}
Run Code Online (Sandbox Code Playgroud) 在默认的Twenty Twelve主题中,当浏览器/屏幕宽度小于600px并且功能不同时,顶部主菜单将更改为按钮.我不知道什么代码控制或设置此替代菜单的样式.
有人可以帮我找到一种方法来禁用/编辑这个吗?
我已添加了Shopify文档中描述的基本联系表单.
我的代码:
{% form 'contact' %}
{% if form.posted_successfully? %}
<div class="successForm feedback">
<p>Thanks for contacting us. We'll get back to you as soon as possible.</p>
</div>
{% endif %}
{% if form.errors %}
<div class="errorForm feedback">
<p>Sorry, we were unable to submit your inquiry because it contained {{ form.errors | size | pluralize: 'an error', 'a few errors' }}.<br/>Please correct the following and submit again:</p>
{% for field in form.errors %}
<p><strong>The {{ field | capitalize | …
Run Code Online (Sandbox Code Playgroud) css ×2
background ×1
contact-form ×1
form-data ×1
form-fields ×1
html ×1
shopify ×1
shorthand ×1
wordpress ×1