I’m creating my website in on WordPress.com and I’m implementing my theme.
I created a folder in wp-content/themes/mytheme and in this folder I created an index.php and a style.css.
Basically my style.css doesn’t want to apply to my page. Here is my CSS and PHP code
index.php:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<title><?php bloginfo( 'name' ); ?></title>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>
<div id="content">
<h1>Hello there!</h1>
<p>This is my website</p>
</div>
<?php wp_footer(); ?>
</body>
</html>
style.css:
body {
background-image: url('wp-content/themes/miotema/images/prima.jpg') !important;
min-height: 100vh !important;
background-color: rgba(234,234,234,0.5);
background-attachment: scroll !important;
background-repeat: no-repeat !important;
background-size: cover;
padding-top: 100px;
padding-bottom: 100px;
}
I tried to put all in my php code adding the line:
style="background-image: url('wp-content/themes/miotema/images/prima.jpg') !important; background-size: cover !important; background-position: center !important;">
and in this case the style that I put in phh applies succesfully.
Is there a problem in linking the CSS to the PHP file? Is this a problem of WordPress that has priority on my style.css?