Home > front end >  css changes not shown in browser
css changes not shown in browser

Time:02-27

i don't think this is worthy question or not but still i am in trouble to find solution. ?

i am working on my first project in php and using notepad editor. so,my problem is when ever i am saving my work and after restarting my laptop something else changes where done in my website(wich i don't done).

?

one more thing changes on padding or margin in file don't shown on browser's console or on website. what is the solution behind it.

CodePudding user response:

  1. Path to the stylesheet from root folder
<link rel="stylesheet" href="./css/styles.css">
  1. You could add some variable to the end of href, such as:
<link rel="stylesheet" type="text/css" href="css/yourStyles.css?<?php echo time(); ?>" />

Change version=1 to version=2 and so on after making some changes to the file content.

CodePudding user response:

If you made changes in the style section or main.css, those can be overwritten and not take effect if you also put styles within the html element. Put some code up and people can help you better.

if you use the ``` code can go in your original post. Edit it.

PHP

<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>

HTML

<link rel="stylesheet" href="css/home.css">

CSS

code .c { /*max-width: 100px; margin: auto; padding-left: 35px; padding-right: 45px;*/ background-image: url(a.jpg); }
console .c { max-width: 1200px; margin: auto; padding-left: 35px; padding-right: 45px; background-image: url(a.jpg); }
  • Related