papa4174
Member
Posted 3 years ago #
I put a css file here:
/public_html/wp-content/themes/mytheme/test.css
How can I edit this code to make it point to this external css file?
Thanks!
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="/test.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p><span class="offerlink">Click Me</span></p>
</body>
</html>
<title>Untitled Document</title>
<link href="<?php bloginfo('template_directory'); ?>/test.css" rel="stylesheet" type="text/css" />
</head>
papa4174
Member
Posted 3 years ago #
stvwolf mind helping edit this code.
I put my css file in:
/public_html/wp-content/themes/mytheme/test.css
here is the html code I put in a new post:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="<?php bloginfo('template_directory'); ?>/test.css" rel="stylesheet" type="text/css" />
</link></head>
<body>
<p><span class="cssname">Click Me</span></p>
</body>
Here is the code in my css:
@charset "utf-8";
.cssname {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #FF6699;
text-decoration: underline;
Not sure what I'm doing wrong
You didn't explain what the problem is.
For one thing you are missing a closing } on .cssname
however I don't know what .cssname relates to or what you are asking for.
papa4174
Member
Posted 3 years ago #
oops I did forget the }
inside of my external file, .cssname is the style name
so I want the the text "Click Me" to be styled by the css file.
but right now my text Click Me in my latest post on my blog is still black. If it were styled by the external css file it should be pink.
Using <head> tags and such in the post won't work. That is already called by header.php.
Simply add the css to the theme main style.css
Or if it is a one time thing, do <span style="your css here;">
Is there a specific reason why you need an external test.css? If so, add the call from header.php of your theme.
papa4174
Member
Posted 3 years ago #
thanks buddha! worked like a charm!