索 HTML 图像的不同概念,以及如何有效地使用它们在您的网站上增加视觉吸引力、传达信息和表达情感。 本指南包含大量示例和实用技巧,可帮助您创建一个视觉效果惊人且用户友好的网站。
图像是网页设计师和开发人员的强大工具,它们可用于传达信息、表达情感并使网站更具视觉吸引力。 HTML 图像概念是网页设计和开发的重要方面。 它们用于将图像嵌入到网页中,以便于显示和共享图片和图形。 在这篇博文中,我们将探讨 HTML 图像的不同概念以及如何有效地使用它们。
首先,让我们谈谈不同类型的 HTML 图像。 有两种主要类型的图像:内嵌图像和背景图像。 内联图像直接嵌入到 HTML 代码中,而背景图像则应用于元素的背景。
在此示例中,内联图像“image.jpg”直接嵌入到 HTML 代码中并显示给用户。
在此示例中,背景图像“image.jpg”应用于 div 元素的背景并显示给用户。
以合乎逻辑且一致的方式使用图像也很重要。 这意味着您应该使用它们来传达与网页内容相关的信息或表达情感,而不是随意使用它们。 此外,使用 alt 属性为图像添加文本替代也很重要,它允许可能使用屏幕阅读器的用户访问图像,或者以防图像加载失败。
在此示例中,替代文本“日落的美丽图像”让用户清楚地了解图像所代表的内容。
另一个 HTML 图像概念是使用宽度和高度属性调整图像大小的能力。 这些属性允许您调整图像大小以适合您的布局和设计。
在此示例中,图像的宽度设置为 300 像素,图像的高度设置为 200 像素。
HTML 图像概念是网页设计和开发的重要方面。 它们用于将图像嵌入到网页中,以便于显示和共享图片和图形。 通过了解不同类型的图像并正确使用它们,您可以为您的网站增加额外的视觉吸引力,并以有力的方式传达信息或表达情感。 无论是使用内联图片还是背景图片,添加替代文本或调整大小,这些概念都是创建视觉效果惊人且用户友好的网站的关键。
但不要只相信我们的话,您自己试试吧! 尝试使用 HTML 图像,看看它们如何增强您网站的整体外观。 通过每一行代码,您离创建一个您的访问者会喜欢的美观且引人入胜的网站又近了一步。 请记住,图像具有唤起情感和传达信息的力量,因此请明智地使用它们并将它们作为您网页设计策略的重要组成部分。 通过正确组合 HTML 和图像,您将创建一个脱颖而出并给访问者留下持久印象的网站。
自蜂鸟网-技法学院,原文链接:https://m.fengniao.com/slide/5358544.html
这些照片是来自Agora Images 2019年度“水”主题摄影比赛的作品,共收集了超过16000张来自全球的作品。不妨看看这些摄影师是如何用摄影来诠释水的魅力的吧!
欢迎关注 蜂鸟网微信公众号:fengniaoweixin
要特色:使用bootstrap搭建,登陆注册在一个页面,背景图片轮播
说明:图片820×560
代码:
<%@ page language=”java” contentType=”text/html; charset=UTF-8″
pageEncoding=”UTF-8″%>
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<title>登录注册</title>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + “://”
+ request.getServerName() + “:” + request.getServerPort()
+ path + “/”;
%>
<link rel=”shortcut icon” href=”<%=basePath %>img/brandbest.png” />
<!– Bootstrap –>
<link href=”<%=basePath %>bootstrap/css/bootstrap.min.css” rel=”stylesheet”>
<style>
body:{
}
#login_div{
width:26%;
hight:30%;
/*float:right;
margin-top:110px;
margin-right:160px; */
margin-left:37%;
margin-top:10%;
color:white;
position:absolute;
z-index:9999;
background-color:#000000;/* IE6和部分IE7内核的浏览器(如QQ浏览器)下颜色被覆盖 */
background-color:rgba(0,0,0,0.3); /* IE6和部分IE7内核的浏览器(如QQ浏览器)会读懂,但解析为透明 */
}
#regist_div{
width:26%;
hight:30%;
/*float:right;
margin-top:110px;
margin-right:160px; */
margin-left:37%;
margin-top:10%;
display:none;
color:white;
position:absolute;
z-index:9999;
background-color:#000000;/* IE6和部分IE7内核的浏览器(如QQ浏览器)下颜色被覆盖 */
background-color:rgba(0,0,0,0.3); /* IE6和部分IE7内核的浏览器(如QQ浏览器)会读懂,但解析为透明 */
}
</style>
<!– HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries –>
<!– WARNING: Respond.js doesn’t work if you view the page via file:// –>
<!–[if lt IE 9]>
<script src=”http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js”></script>
<script src=”http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js”></script>
<![endif]–>
<!– <script type=”text/javascript” src=”js/jquery-3.1.1.js”></script> –>
<script type=”text/javascript” src=”<%=basePath %>js/jquery-1.11.3.js”></script>
<script type=”text/javascript”>
$(function(){
$(“#gologin”).click(function(){
$(“#login_div”).show();
$(“#regist_div”).hide();
});
$(“#goregist”).click(function(){
$(“#login_div”).hide();
$(“#regist_div”).show();
});
});
</script>
</head>
<body>
<div class=”bg” style=”width:100%;height:100%;position:absolute;”>
<div id=”carousel-example-generic” class=”carousel slide” data-ride=”carousel”>
<!– Indicators –>
<ol class=”carousel-indicators”>
<li style=”display:none;” data-target=”#carousel-example-generic” data-slide-to=”0″ class=”active”></li>
<li style=”display:none;” data-target=”#carousel-example-generic” data-slide-to=”1″></li>
<li style=”display:none;” data-target=”#carousel-example-generic” data-slide-to=”2″></li>
</ol>
<!– Wrapper for slides –>
<div class=”carousel-inner” role=”listbox”>
<div class=”item active”>
<img style=”width:100%;” src=”<%=basePath %>img/bg1.jpg” alt=”…”>
<div class=”carousel-caption”>
<!– bg1.jpg –>
</div>
</div>
<div class=”item”>
<img style=”width:100%;” src=”<%=basePath %>img/bg2.jpg” alt=”…”>
<div class=”carousel-caption”>
<!– bg2.jpg –>
</div>
</div>
<div class=”item”>
<img style=”width:100%;” src=”<%=basePath %>img/bg3.jpg” alt=”…”>
<div class=”carousel-caption”>
<!– bg3.jpg –>
</div>
</div>
<!– … –>
</div>
<!– Controls –>
<!– <a class=”left carousel-control” href=”#carousel-example-generic” role=”button” data-slide=”prev”>
<span class=”glyphicon glyphicon-chevron-left”></span>
<span class=”sr-only”>Previous</span>
</a>
<a class=”right carousel-control” href=”#carousel-example-generic” role=”button” data-slide=”next”>
<span class=”glyphicon glyphicon-chevron-right”></span>
<span class=”sr-only”>Next</span>
</a> –>
</div>
</div>
<!– 登录框 –>
<div class=”loginAndRegist”>
<div id=”regist_div”>
<form>
<p style=”text-align:center;font-size:25px;”>用户注册 <a id=”gologin” style=”font-size:10px;cursor:pointer;”>去登录</a></p>
<div class=”form-group”>
<label for=”exampleInputEmail1″>账号</label> <input
type=”email” class=”form-control” id=”regist_name”
placeholder=”account”>
*请认真填写需求信息,我们会在24小时内与您取得联系。