PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, December 29, 2021

[FIXED] Why can I not get my css to render in mamp?

 December 29, 2021     css, mamp, wordpress     No comments   

Issue

I have set up wordpress locally on my mac using Mamp and everything but the css file is not working. I can get the link for the CSS file right and when inspecting the code in Chrome and Safari it shows the right CSS file. But no matter what type of CSS codes I write it is not showing on my page.

Here is my header.php file

<html>
<head>
    <meta charset="utf-8"/>
    <link rel=”stylesheet” href="<?php bloginfo('stylesheet_url'); ?>" type=”text/css” media=”screen” />
    <title>My first website</title>
</head>
<body>

And here is the CSS I'm trying to render:

* {
    margin: 0;
    padding: 0;
}

#wrapper {
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

So when it shows the code in the browser it looks like this

<html>
<head>
    <meta charset="utf-8"/>
    <link rel=”stylesheet” href="http://localhost/firstsite/wp-content/themes/newtheme/style.css" type=”text/css” media=”screen” />
    <title>My first website</title>
</head> ```

I can even click the CSS file from the inspected code and will then see the right file. What am I doing wrong here? PS. I have tried hard refresh of Chrome.

Solution

The solution was the wrong usage of quotes as @gtamborero suggested. Thank you for that. Now the browser is reading the CSS perfectly.



Answered By - Nicolai Funch
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing