Javascript 我添加了图像,但没有';t出现了
我添加了一个图像林,但它没有出现在网站上。在web中,expression 4可以正常工作。我添加了背景蓝,我想要背景蓝。它在学校环境中运行良好 为什么我的网站上的图片看起来不一样Javascript 我添加了图像,但没有';t出现了,javascript,html,css,Javascript,Html,Css,我添加了一个图像林,但它没有出现在网站上。在web中,expression 4可以正常工作。我添加了背景蓝,我想要背景蓝。它在学校环境中运行良好 为什么我的网站上的图片看起来不一样 <!DOCTYPE html> <html> <head> <title>ME</title> <meta charset="UTF-8"> <meta name="viewport" cont
<!DOCTYPE html>
<html>
<head>
<title>ME</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
</head>
<body>
<div class="bgimg w3-display-container w3-animate-opacity w3-text-white">
<div class="w3-display-topleft w3-padding-large w3-xlarge">
Logo
</div>
<div class="w3-display-middle">
<h1 class="auto-style2">Me</h1>
<hr class="w3-border-grey" style="margin:auto;width:40%">
<p class="w3-large w3-center">Personal Informations</p>
</div>
<div class="w3-display-bottomleft w3-padding-large">
Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank">me</a>
</div>
</div>
<p><img alt="forestbridge" height="963" src="forest%20bridge.jpg" width="1642"></p>
</body>
<style type="text/css">
body {
background-color: blue;
}
.auto-style1 {
margin-right: 663px;
}
body,h1 {font-family: "Raleway", sans-serif}
body, html {height: 100%}
.bgimg {
background-image: url('/w3images/forestbridge.jpg');
min-height: 100%;
background-position: center;
background-size: cover;
}
.auto-style2 {
color: #000;
font-family: "Segoe Print";
}
</style>
我
标志
我
技术支持
身体{
背景颜色:蓝色;
}
.auto-style1{
右边距:663px;
}
正文,h1{字体系列:“Raleway”,无衬线}
正文,html{height:100%}
.bgimg{
背景图像:url('/w3images/forestbridge.jpg');
最小高度:100%;
背景位置:中心;
背景尺寸:封面;
}
.auto-style2{
颜色:#000;
字体系列:“Segoe打印”;
}
正文{
背景颜色:蓝色;
}
.auto-style1{
右边距:663px;
}
正文,h1{字体系列:“Raleway”,无衬线}
正文,html{height:100%}
.bgimg{
背景图像:url('https://www.w3schools.com/w3images/forestbridge.jpg');
最小高度:100%;
背景位置:中心;
背景尺寸:封面;
}
.auto-style2{
颜色:#000;
字体系列:“Segoe打印”;
}
我
标志
我
技术支持
更改背景图像:url('/w3images/forestbridge.jpg')代码>至
https://www.w3schools.com/w3images/forestbridge.jpg
您应该使用外部资源的绝对路径 您需要放置图像的完整路径。将css.bgimg
类中的“/w3images/forestbridge.jpg”更改为“”,我不确定放置
的目的是什么,因为它似乎是多余的,所以请尝试删除它或将其更改为其他图像 url图像与您需要在auto-style2中添加绝对路径…@JackPutter相对?