Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting CSS style in <p> not working- Codeigniter

Tags:

css

This below code is not applying the class mentioned in the p tag in chrome but working in IE, Firefox
<p class="p_error"><?php print $this->validation->errorValue;?></p>
Here CSS -> .p_error{ color:red; text-align:left; font-size:12px; }

Any hint or reason why its not working?
From the chrome output ->using inspect element ->
<p class="p_error"></p>
<p>The Treated By field is required.</p>

like image 993
ASD Avatar asked Dec 23 '22 01:12

ASD


2 Answers

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>

like image 65
ASD Avatar answered Dec 24 '22 15:12

ASD


What does your CSS look like? It should look something like:

.p_error {
  color: red;
  font-weight: bold;
}
like image 21
Paige Ruten Avatar answered Dec 24 '22 15:12

Paige Ruten