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
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.