Search code examples
phphtmlcssstylesheet

External Style Sheet


I've created an CSS external style sheet for a webpage of my website. I have uploaded it to the server and have used the following code in my PHP file to load the webpage. However, the webpage just loads as if it ignores the style sheet. Here's the code in the PHP file that I have used so I just uploaded the HTML tags here. Any help would be a great help. Thanks.

<html>
<head>
<link  rel="styleshhet" type="text/css" href="/webspace/httpdocs/new_select3_style_sheet.css">
<script>function goBack() {window.history.back()}
</script>
</head>
<body>
<div id="main">

</div>
</body>
</html> 

Solution

  • <link  rel="styleshhet" type="text/css" href="/webspace/httpdocs/new_select3_style_sheet.css">
    

    goes to:

     <link  rel="stylesheet" type="text/css" href="new_select3_style_sheet.css">
    

    First you had a typo -> stylesheet not stylshhet second all paths run from above httpdocs in public facing HTML (where your site will be) so you need to remove everything above that! e.g.

    /webspace/httpdocs/new_select3_style_sheet.css 
    

    If your domain was example.com then /webspace/httpdocs/ = example.com/ when building URLs