我是自定义 CSS 的新手。我的老板希望我在 Qualtrics 中添加自定义 CSS(在外观/高级下)。在编辑预览窗口中,一切似乎都格式正确,但在实际调查页面上,许多元素的格式并未应用:图像是原始大小,div 不可见,等等。
我假设这与个别浏览器有关,我必须指定某些东西,例如 webkit 东西,但我不太了解。这是我的一段简单代码(图像是我最关心的):
HTML:
<img id="bing" src="http://i39.tinypic.com/16kc3k0.jpg">;
CSS:
#bing{
display:block;
width:15%;
height:15%;
}
我知道有一些属性比如
-webkit-appearance: cover;
-moz-appearance: cover;
最佳答案
阅读此 Percentage Height HTML 5/CSS
"If you want to make the div height a percentage of the viewport height, every ancestor of the div, including and , have to have height: 100%, so there is a chain of explicit percentage heights down to the div."
如果您对工具有疑问,请尝试通过编写来添加内联样式
<img id="bing" style="display:block; width:15%; height:15%; " src="http://i39.tinypic.com/16kc3k0.jpg">;
编辑:真正应该在 CSS 中设置样式。想出你的工具来这样做,并找出任何其他不允许你这样做的问题..
关于javascript - 自定义 CSS(质量),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19209210/