Ich baue eine Website verwenden PHP. Ich fertige alle html
, css
, js
zuerst wie das Bild zeigt.CSS Hintergrundbilder fehlgeschlagen nach Konvertierung von HTML nach PHP
Und dann beginne ich zu konvertieren html
zu php
.
Doch nach html
-php
, das Hintergrundbild in css
Umwandlung fehlschlägt. Ich habe den Pfad überprüft, es funktioniert in der HTML.
Ich habe keine Ahnung, was mit dem Code falsch ist.
Benötige ich spezielle CSS-Operationen, wenn ich HTML in PHP umwandle?
body {
background: url('../img/bg3.jpg') center;
position: relative;
height:1300px;
}
#wrapper{ height:1500px;}
#wrapper{overflow: hidden;}
.wrapper-head {
background: black url('../img/head.jpg') center no-repeat;
margin: 0 auto;
width: 908px;
height: 178px;
margin-top: 39px;
margin-bottom: 0px;
box-shadow: -2px 0 20px 1px #7f7e7f, 0 -2px 20px 1px #7f7e7f, 2px 0 20px 1px #7f7e7f;
border-bottom: solid 1px #ff0000;
position: relative;
}
.wrapper-head img {
float: right;
position: relative;
}
.wrapper-nav {
background: url('../img/nav.jpg') center no-repeat;
width: 1009px;
height: 83px;
margin: 0 auto;
margin-top: 0px;
-ms-transform: translate(0px, -33px);
/* IE 9 */
-webkit-transform: translate(0px, -33px);
/* Safari */
transform: translate(0px, -33px);
/* Standard syntax */
margin-bottom: 0px;[![enter image description here][2]][2]
color: #281d04;
}
Der ganze Weg ist:
/Applications/XAMPP/xamppfiles/htdocs/myblog/petshop/public
etwas Besonderes ist, dass, wenn ich diesen Weg zu öffnen:
http://localhost/petshop/public/img/bg3.jpg
heißt es:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.23 (Unix) OpenSSL/1.0.2h PHP/7.0.9 mod_perl/2.0.8-dev Perl/v5.16.3
Andere Foto verwendet in html aus dem gleichen Ordner kann nur funktionieren die drei in CSS versagt.
Können Sie den entsprechenden Code posten? –
Was meinst du damit, HTML in PHP zu konvertieren? Der HTML-Code kann außerhalb der Tags in die PHP-Datei eingefügt werden. – ottiem
Suchen und ersetzen Sie alle Ihre Dateien "index.html to index.php". Es gibt nichts weiter zu tun, wenn Sie eine HTML-Datei in PHP ändern. Ich denke, es gibt einen falschen Pfad in Ihrem CSS. Können Sie Ihren gesamten Code bereitstellen? –