0

In WordPress, am creating a new post. In the HTML section of the post am using the following code:

<html>
<head>
<style type="text/css">
body {color:red;}
h1 {color:#00ff00;}
p.ex {color:rgb(0,0,255);}
</style>
</head>

<body>
<h1>This is heading 1</h1>
<p>This is an ordinary paragraph. Notice that this text is red. The default text-color for a page is defined in the body selector.</p>
<p class="ex">This is a paragraph with class="ex". This text is blue.</p>
</body>
</html>

The text h1 font size is not coming that much, please help with this.

1
  • You're adding <html>, <head> and <body> tags to your post? Don't. WordPress will handle all that, just put in the code for your post. Also, can you clarify what the problem is? "Size not coming that much" is not a clear statement of problem to me. Commented May 16, 2012 at 14:05

2 Answers 2

1

Within the <style> section, add:

h1, p {font-size:14px} or whatever size you want to use.

Sign up to request clarification or add additional context in comments.

3 Comments

Then you're doing it wrong or your sample code does not match reality.
sir..am trying this one..have a look w3schools.com/css/tryit.asp?filename=trycss_color
Assuming you correctly placed that into the <style> element, the only reason this would not work is if the wordpress theme you are using assigns a size to the <h1> element outside of the CSS you control. We would need to see the actual HTML being generated before we could debug that issue.
0

First, if your writting into the POST (html) you should not use the and so into the field.

Your post should only looks like this

 <style type="text/css">
body {color:red;}
h1 {color:#00ff00;}
p.ex {color:rgb(0,0,255);}
</style>
</head>

<body>
<h1>This is heading 1</h1>
<p>This is an ordinary paragraph. Notice that this text is red. The default text-color for a page is defined in the body selector.</p>
<p class="ex">This is a paragraph with class="ex". This text is blue.</p>

But the fact is that why your not placing your css into a specific CSS file? In the root of your theme, your should have a default style.css to use.

Also, can you check that your using a reset.css or something like this that would overwrite what your entered into the field?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.