how to add additional fieldsets

Discussion in 'CSS' started by lithman, Aug 6, 2007.

  1. #1
    Currently I have a fieldset in my CSS. Looks like this:

    fieldset
    {
    border: 2px solid #660000;
    font-size: 4px;
    }


    Now I need to add a new fieldset to a table I have, but this fieldset needs to have a define width of 280. So, is this what I add in my CSS?

    fieldset2
    {
    border: 2px solid #660000;
    font-size: 4px;
    width: 280px;
    }

    And then in the code of the page I would do <fieldset2> </fieldset2> ?

    I ask this, because I tried the above method and it didn't work. It doesn't define the width as 280, is stretches the fieldset across the entire width of the page.
     
    lithman, Aug 6, 2007 IP
  2. lithman

    lithman Well-Known Member

    Messages:
    1,189
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #2
    Nevermind. I got it by adding an id="idname" to the second fieldset instead of naming it fieldset2
     
    lithman, Aug 6, 2007 IP
  3. euler

    euler Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    .class1
    {
    border: 2px solid #660000;
    font-size: 4px;
    }

    .class2
    {
    border: 2px solid #660000;
    font-size: 4px;
    width: 280px;
    }

    ...

    <fieldset class="class1">...</fieldset>
    <fieldset class="class2">...</fieldset>
     
    euler, Aug 6, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Understand that Internet Explorer doesn't handle the styling of fieldsets very well. I suggest you read Legends of Style by John "Tyssen" Faulds (tyssendesign.com.au).

    And please, don't use tables to lay out your forms.
     
    Dan Schulz, Aug 6, 2007 IP