开发者

Border around legend in form does not show

开发者 https://www.devze.com 2023-03-03 18:43 出处:网络
I have a simple CodeIgniter view that simply refuses to show the border around the form even though I have used the fieldset and legend tags.

I have a simple CodeIgniter view that simply refuses to show the border around the form even though I have used the fieldset and legend tags.

I don't believe the CSS is overriding this anywhere but at this point I don't even know how to check (a fairly large CSS split over multip开发者_Python百科le files if this statement is true).

Here's the simple HTML. Help!

<fieldset>
<legend>Log In</legend>
<?php

echo form_open('form/login');
echo form_input('email', set_value('email', 'Email'));
echo form_password('password', set_value('password', 'Password'));
echo form_submit('submit', 'Log In');
echo form_close();

?>
</fieldset>


The problem is your html is not valid.

The <fieldset> tags go inside your <form>

<?=form_open('form/login');?>
<fieldset>
   <legend>Log In</legend>
   <?
     echo form_input('email', set_value('email', 'Email'));
     echo form_password('password', set_value('password', 'Password'));
     echo form_submit('submit', 'Log In');
   ?>
</fieldset>
<?=form_close();?>

If this does not fix it for you (which I imagine it will):

Using Google Chrome or Firebug Extension for Firefox you can inspect an element on your page by right clicking on it and chosing Inspect Element. This will bring you to the dom explorer and you'll be able to see all CSS Syles being applied to an object and where they are coming from. This should help you narrow down a CSS style that might be overriding the default visuals. (And confirm/deny the existance of such a conflict).


Rather than deleting it in the reset you should load reset first then override that in your bespoke CSS. If you start messing with the reset you might give yourself problems later

0

精彩评论

暂无评论...
验证码 换一张
取 消