【发布时间】:2016-10-13 01:04:21
【问题描述】:
我找到了这个 html 代码,我想修改它以将图像加载到 html 代码中:
<section class="bg-img well-top">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-offset-2 col-sm-8">
<form class="search-form" action="http://static.livedemo00.template-help.com/wt_57621/search.php" method="GET" accept-charset="utf-8">
<label class="search-form_label">
<input class="search-form_input" type="text" name="s" autocomplete="off" placeholder="Search Scripts"/>
<span class="search-form_liveout"></span>
</label>
<button class="search-form_submit fa-search" type="submit"></button>
</form>
</div>
</div>
</div>
</section>
CSS 代码:
.bg-img {
background: no-repeat url(../images/bg-img.jpg);
background-size: cover;
padding-top: 90px;
padding-bottom: 133px;
text-align: center; }
@media (max-width: 767px) {
.bg-img {
padding-top: 70px;
padding-bottom: 80px; } }
我想将图像文件加载到 html 代码中。
【问题讨论】:
-
您可以使用 canvas 和 javascript 将图像加载到 html5 中。示例here
-
我可以使用html标签吗?
-
你的意思是
<img>...? -
我想获得相同的视觉效果,但使用 html 代码加载图像。
-
@CBroe 是的,但我怎样才能获得相同的视觉效果?