WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] CSS Not Working (6 posts)

  1. Connor Crosby
    Member
    Posted 3 years ago #

    I am making a WordPress theme and I brought all the code over to an index.php and style.css file in a theme folder. The problem is that the CSS code is not effecting the HTML and PHP. It looks as if it is unstyled (browser default). I checked the <head> and it shows the link to the stylesheet.

    Here is the code I used to link to the stylesheet:
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    When I go to the stylesheet link, it only shows the commented area information (name, description, URI, etc), but when I go to my coding software it shows up fine. And yes, I am looking at the online version, not offline.

    What could make this happen? I have tried everything I can think of. Please help!!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Have you tried validating your CSS?

  3. Connor Crosby
    Member
    Posted 3 years ago #

    It shows a couple of errors, but wouldn't it still at least show some elements. Here is the link by the way.

    http://connorcrosby.net

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    You need to sort out the first two errors. They may stop parts of the CSS working in its tracks. You've also got some markup errors that need sorting.

    There's definitely a problem in the style.css file. I can't access anything beyond the comment heading. What are you using to create the file? Is the file being saved with the correct file type encoding?

  5. Connor Crosby
    Member
    Posted 3 years ago #

    Oh nevermind. When I updated my site (deleted a post) it shows the site normally, plus the CSS file updated.

  6. Connor Crosby
    Member
    Posted 3 years ago #

    You were viewing that when I deleted a couple lines of code to see if that would correct the problem, that is why there were errors. I know there is still some left, but I will fix that later.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags