BubblesSOC

Hi I'm Bubs, welcome to my home on the web!

Thanks for stopping by! You have stumbled upon the personal website of Sidney Collins (aka Bubs). I'm a 24-year old student at the University of Alabama studying Computer Science and Mathematics. When I'm not busy programming you'll probably find me writing, drawing, reading, shopping, eating, or playing Monopoly.

Read More


May 4

IE Fieldset Bug

i have to type this entry in lowercase because my keyboard is acting up again :-P

in my quest to convert my site to pure css, i’ve been working a lot with styled fieldsets using a great tutorial found here. i stumbled upon a bug that’s been bothering me for days. the textarea and submit button inside of my fieldsets keep getting shoved over in ie, causing the entire layout to collapse. the other form elements, however, are not affected.

here’s what it’s supposed to look like (firefox)
here’s what it looks like in ie

after tweaking the stylesheet a bit, i discovered that the textarea/button nested inside the fieldset was inheriting all other specified left-margins in ie. here’s an example of what i mean:

the textarea is shoved to the right by 25 pixels, even though the margins were specified as zero

the code:

<div class="cont1">
     .cont1
     <div class="cont2">
          .cont2
          <fieldset>
               <textarea cols="10" rows="5"></textarea><br />
               <input type="button" value="Button" />
          </fieldset>
     </div>
</div>

the css:

.cont1 {
     background: blue;
     margin: 0 0 0 10px;
     padding: 5px;
}
.cont2 {
     background: yellow;
     margin: 0 0 0 15px;
     padding: 5px;
}
fieldset {
     margin: 0;
     padding: 0;
}
fieldset textarea {
     margin: 0;
     padding: 0;
}

the textarea and input button are shoved to the right by 25 pixels (the left margin of cont1 + the left margin of cont2). i haven’t had time to do thorough research, but as far as i know, there is no workaround for this bug. i did find someone else who had the same problem, however. someone suggested in the comments to enclose the elements in an arbitrary div, and that seemed to work for me.

textarea and input button enclosed by an arbitrary div

new code (same stylesheet):

<div class="cont1">
     .cont1
     <div class="cont2">
          .cont2
          <fieldset>
               <div class="arbitrary">
                    <textarea cols="10" rows="5"></textarea><br />
                    <input type="button" value="Button" />
               </div>
          </fieldset>
     </div>
</div>

the arbitrary div idea is fine for now, but i’d like to find another way to remedy this bug. has anyone else had this problem? if so, how did you fix it?

this is the last week of the semester! hopefully i’ll be back to blogging regularly by next week :-)


Post Info

Bubs posted this entry 3 years, 3 months ago on Wednesday, May 4th, 2005 at 6:38 am.


Comments So Far

19 people have commented on the post “IE Fieldset Bug.” Why don't you leave a comment?

  1. Samantha's Gravatar

    Samantha (Quote)

    Hi bubblessoc, hope you reply to me soon :nod:

    Wed May 4th, 2005 8:19 am

  2. natasja's Gravatar

    natasja (Quote)

    First of all I hate IE ;) Secondly, this might have to do with the box model, but I’m not sure, since you didn’t work with fixed sizes.

    You can make a different rule for IE in the CSS (after the .cont2 style) like this:
    *html .cont2 {
    margin: 0px;
    }
    Hope this works?

    Thu May 5th, 2005 3:40 am

  3. tuan's Gravatar

    tuan (Quote)

    you make css sound so complex o.O

    Thu May 5th, 2005 6:02 am

  4. Bubs's Gravatar

    Bubs (Quote)

    hmm, i tried the *html rule… it worked for ie, but gave me a css validation error O_o are there any other ie-only rules? thanks for that one, btw

    Fri May 6th, 2005 12:01 am

  5. Dayna's Gravatar

    Dayna (Quote)

    Hmm.. yea.. that looks complicated… O_o at least for me.. :hehe: Hope you get it fixed soon :devil:

    Fri May 6th, 2005 10:40 am

  6. Brigitte's Gravatar

    Brigitte (Quote)

    Your superfly ability to code makes me smile. Thanks for all your help with my blog, by the way. It looks much better now! *hugs*

    Fri May 6th, 2005 6:30 pm

  7. Yvonne's Gravatar

    Yvonne (Quote)

    Lol, I’m sure i could understand the contents of your post but at this point in time, it just looks like a whole new language to me. X_X

    Tue May 10th, 2005 11:15 pm

  8. Jenny's Gravatar

    Jenny (Quote)

    css is hard. hey… no more gravatars? aw… and i just got a new one too.

    Wed May 11th, 2005 3:20 pm

  9. Bubs's Gravatar

    Bubs (Quote)

    They’ll be back sometime :)

    Wed May 11th, 2005 5:03 pm

  10. Jenny's Gravatar

    Jenny (Quote)

    wee! :nod:

    Thu May 12th, 2005 12:28 am

  11. Ryan's Gravatar

    Ryan (Quote)

    Your site is always so pretty. I love it. CSS rules. =)

    Thu May 12th, 2005 12:45 pm

  12. shirley's Gravatar

    shirley (Quote)

    Wow.. to me.. coding everything in css sounds like the impossible XD haha… it’ll probably take me ages.. but you’re more advance then I am ^^ Good luck!

    Sun May 15th, 2005 1:28 am

  13. Yajaira's Gravatar

    Yajaira (Quote)

    Woah…I’m BARELY getting into the “css layout” thing and man, that looks complicated LOL. Good luck with your coding!

    Mon May 16th, 2005 10:34 am

  14. Aneesah's Gravatar

    Aneesah (Quote)

    Yeah, I’ve seen tutorials on customising forms via CSS, it’s so neat, isn’t it? I haven’t tried anything myself, though. ‘Cause I’ll always find something wrong and then not being able to solve it and then giving up. ^^;

    They should make IE disappear someday.

    Fri May 20th, 2005 5:58 am

  15. Marie's Gravatar

    Marie (Quote)

    hey! love the new layout Bubs! :beat:

    Fri May 20th, 2005 7:18 pm

  16. jr's Gravatar

    jr (Quote)

    hope the keyboard works better

    Sun May 22nd, 2005 12:29 am

  17. manda's Gravatar

    manda (Quote)

    BLERGH! IE! It annoys me more and more…

    I loooove this new look. Fruit are cool, and they’re so cute! My keyboard screwed up big time once, and I couldn’t be bothered to fix up all the typos that happened so everyone thought I was drunk lol

    Mon May 23rd, 2005 1:47 am

  18. Lauren's Gravatar

    Lauren (Quote)

    IE doesn’t understand the !important; declaration, so you can do something like this for .cont2:
    margin: 0 0 0 15px!important;
    margin: 0;

    Mon May 30th, 2005 10:50 am

  19. Bubbila's Gravatar

    Bubbila (Quote)

    Sweet resource, just what I have been looking for.

    Thu Mar 27th, 2008 3:09 pm

Leave a Comment

Leave a Comment

Name, email, and comment required. Email never displayed. Upload a Gravatar to be displayed with your comment. Comments containing links will be moderated for spam prevention.

« New Skin: Fruit Basket
Revenge of the Sid »

Search

Search the Archives

Hop to the Top