3

I'm trying to use a fieldset but it is not working as exactly i wanted... The legend is displayed outside fieldset...But I want it covered like normal fieldsets. My code is,

<fieldset style="border:1px solid #999; border-radius:8px; box-shadow:0 0 8px #999;padding:6px;">
<legend style="text-align: left;margin-top:-15px;">References</legend>
//Some Text...
</fieldset>
Pedi
  • 63
  • 1
  • 2
  • 12

2 Answers2

1

<fieldset>
  <legend>References</legend>
  //text
 </fieldset>
Tushar Gupta
  • 15,504
  • 1
  • 29
  • 47
  • 1
    Means ? I ve posted a snipped but it runs fine? Have you posted whole of your code? – Tushar Gupta Oct 10 '14 at 06:56
  • 1
    Ya, It works fine in the code snippet.But I'm working on a Yii project and it still doesn't work...Check this (question code), it worked but the fieldset is not complete it looks like a water tub... http://stackoverflow.com/questions/20414791/border-radius-in-fieldset-doesnt-work – Pedi Oct 10 '14 at 07:49
0

I think this issue is in the margin-top:-15px;, specifically in the -15px which is making the margin -15px larger (in other words 15pxsmaller!).

Example(Without margin-top:-15px;):

<fieldset style="border:1px solid #999; border-radius:8px; box-shadow:0 0 8px #999;padding:6px;">
<legend style="text-align: left;">References</legend>
//Some Text...
</fieldset>