<!DOCTYPE html>
<html>
<head>
<style>
img{
border: 2px solid red;
border-radius:5px;
padding:10px;
}
h2{
color:red;
}
</style>
</head>
<body>
<h1>缩略图</h1>
<img src="../uploads/html/rose.jpg"></img>
<h2>Welcome to lidihuo</h2>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
img{
border: 2px solid red;
border-radius:5px;
padding:10px;
opacity:0.3;
}
h2{
color:red;
}
</style>
</head>
<body>
<h1>透明图像</h1>
<img src="../uploads/html/rose.jpg"></img>
<h2>Welcome to lidihuo</h2>
</body>
</html>
border-top-right-radius:它设置所有四个border-radius属性。
border-top-right-radius:设置右上角的边框。
border-top-left-radius:它设置左上角的边框。
border-bottom-right-radius:它设置右下角的边框。
border-bottom-left-radius:它设置左下角的边框。
<!DOCTYPE html>
<html>
<head>
<style>
#img1{
border: 2px solid green;
border-radius:10px;
padding:5px;
}
#img2{
border: 2px solid green;
border-radius:50%;
padding:5px;
}
h2{
color:red;
}
</style>
</head>
<body>
<h1>圆角图像</h1>
<img src="../uploads/html/rose.jpg" id="img1"></img>
<h2>Welcome to lidihuo</h2>
<h1>Circle Image</h1>
<img src="../uploads/html/rose.jpg" id="img2"></img>
<h2>Welcome to lidihuo</h2>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
#img1{
max-width:100%;
height:auto;
}
h2{
color:red;
}
</style>
</head>
<body>
<h1>自适应图像</h1>
<h2>您可以调整浏览器大小以查看效果</h2>
<img src="../uploads/html/rose.jpg" id="img1" width="1000" height="300"></img>
<h2>Welcome to lidihuo</h2>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
#img1{
margin-left:auto;
margin-right:auto;
display:block;
}
h1,h2{
text-align:center;
}
</style>
</head>
<body>
<h1>使图像居中</h1>
<img src="../uploads/html/rose.jpg" id="img1"></img>
<h2>Welcome to lidihuo</h2>
</body>
</html>