error in including css file
error in including css file
styles.css
/* Footer */
.footer
background-image: url("footer.jpg");
background-repeat: no-repeat;
background-size: cover;
width: 100%;
height: auto;
footer.php
<link rel='stylesheet' href='styles.css'>
<div class="footer"><br>
<div class="container">
<div class="row">
<div class="col-sm-3 col-sm-offset-1">
<h2 style="color:white"><b>Address</b></h2>
<p style="color:white">Son Of xyz</p>
<p style="color:white">bangalore 560040</p>
<p style="color:white">karnataka india </p>
</div>
<div class="col-sm-3 col-sm-offset-1">
<h2 style="color:white"><b>Contact</b></h2>
<p style="color:white"><b>E-mail:</b> xyz@gmail.com</p>
<p style="color:white"><b>Phone:</b> +91 9999999999</p>
<p style="color:white"><b>Fax:</b> +91 9999999999</p>
</div>
<div class="col-sm-3 col-sm-offset-1">
<h2 style="color:white"><b>Usefull Links</b></h2>
<div class="row">
<div class="col-sm-3">
<p><a href="" style="color:white">Home</a></p>
<p><a href="" style="color:white">About Us</a></p>
<p><a href="" style="color:white">Portfolio</a></p>
</div>
<div class="col-sm-1">
<p><a href="" style="color:white">Products</a></p>
<p><a href="" style="color:white">Careers</a></p>
<p><a href="" style="color:white">Contact</a></p>
</div>
</div>
</div>
</div><hr>
<div class="row">
<div class="col-sm-">
<center><p style="color:white;"><i class="fa fa-copyright" style="font-size:24px"></i> Copyright 2018 Samson Solar - All Rights Reserved</p></center>
</div>
</div>
</div>
</div>
I'm creating a web page with .php extension, I'm trying to include the css file in the footer.php page but its not getting displayed. please can any one tell me how may i do this. The same code when used in .html file is working but is not working if I use it as .php extension.
its still not working sir
– pavan kumar
yesterday
do hard refresh and check ctrl + f5
– Pattatharasu Nataraj
yesterday
Just put that
<link> in a <head>– AymDev
yesterday
<link>
<head>
With almost all modern browsers there is a built in developer's tool called inspector.. if you are using chrome you can access it by pressing F12
– Tarek.hms
yesterday
3 Answers
3
U may try
<link rel='stylesheet' href='./styles.css' type='text/css'>
Make sure your footer.php and your style.css in the same directory.
its not working sir i don know whats wrong in this
– pavan kumar
yesterday
This reads like a game of spot the difference rather than an answer. What did you change? Why should it solve the problem?
– Quentin
yesterday
sir its working with .html but not working with .php extension
– pavan kumar
yesterday
try this:echo "<link rel='stylesheet' href='styles.css' type='text/css'>";(without the php code, you can link css files directly from HTML)
echo "<link rel='stylesheet' href='styles.css' type='text/css'>";
also I am just wondering, but wouldn't tables work better for you in this situation? as I see a lot of nested div's.
First past below code in css and see result it's working or not try it
.footer
background-image: url("footer.jpg");
background-repeat: no-repeat;
background-size: cover;
width: 100%;
height: auto;
background-color: red;
sir its working with .html but not working with .php extension
– pavan kumar
yesterday
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
no need to echo a css file you can link that directly
– Pattatharasu Nataraj
yesterday