What does your CSS look like? It should look something like:
.p_error {
color: red;
font-weight: bold;
}
What does your CSS look like? It should look something like:
.p_error {
color: red;
font-weight: bold;
}
yes, i suggest u clear ur cache.... delete recent history --> check cache option and reload current page. Check to see ur doctype is not strict
my gues is that inside $errorValue you have some other html tags which overload the <p>
style declaration
when you browse your page, make sure to hold the Shift button and press refresh. That way your browser will load up the new CSS (assuming you've added p_error
since initially loading the page)
By default, the system adds a paragraph tag (<p>
) around each error message shown. You can easily change these delimiters with this code, placed in your controller:
$this->validation->set_error_delimiters('<div class="error">', '</div>');
for Ref: http://codeigniter.com/user_guide/libraries/validation.html>
This is the code that PHP script generated:
<p class="p_error"><p>The Treated By field is required.</p></p>
HTML specification states that:
</P>
tag may be omitted (it is implied)Those rules mean that you can write something like this:
<p>First paragraph
<p>Second paragraph
Browser will automatically close the first paragraph (i.e. add</p>
) before the second <p>
.
In your case, it means that the error ends up outside of the p_error
paragraph, as the "inspect element" shows:
<p class="p_error"></p>
<p>The Treated By field is required.</p>
One easy way to fix it would be to change your code to this:
CSS (no change)
.p_error{ color:red; text-align:left; font-size:12px; }
PHP (change P to DIV)
<div class="p_error"><?php print $this->validation->errorValue;?></div>