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

Sunday, March 13, 2022

[FIXED] Why does the CSS not affect the header?

 March 13, 2022     css, html, wordpress     No comments   

Issue

I'm working on a Wordpress project, and when i wrote everything by hand for a static HTML page, the CSS worked fine. Now when i do it in wordpress, it seems to not get my commands.

The header file is as follows:

<html>
<head>
<title>Simons sida</title>
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(). '/style.css' ?>">

</head>

<body>

<div id="ttr_header">
<h1>HEADER</h1>
</div>
<div class="container">

While the external CSS for that is

#ttr_header {
    padding: 60px;
    text-align: center;
    background: #1abc9c;
    color: rgb(255, 255, 255);
    font-size: 30px;
  }

The sidebar works properly, but the header doesn't get affected at all, so i don't get what i'm doing wrong.


Solution

    #ttr_header h1 {
        padding: 60px;
        text-align: center;
        background: #1abc9c;
        color: rgb(255, 255, 255);
        font-size: 30px;
    }
<div id="ttr_header">
<h1>HEADER</h1>
</div>
<div class="container"></div>

Changing the selector might help as you are targeting the div instead of the header:

#ttr_header h1 {
    padding: 60px;
    text-align: center;
    background: #1abc9c;
    color: rgb(255, 255, 255);
    font-size: 30px;
}


Answered By - K K
  • 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