You think you know HTML ?Pls Help me solve this..

Discussion in 'HTML & Website Design' started by cooljeba, Jan 23, 2009.

  1. #1
    Well that is what even I thought that I knew HTML.

    Here is the situation that I have attached..


    I want the height of the listbox to the red mark so that I get a smaller listbox. I could manage the width of the textbox using css. But unable to control the vertical.

    thanks for looking in..


    ..:: peace ::..
    Jeba
     

    Attached Files:

    cooljeba, Jan 23, 2009 IP
  2. Astroman

    Astroman Well-Known Member

    Messages:
    2,355
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Have you tried something like this: <SELECT height=20 in the html?

    For example, this will display the first 20 and you scroll down to see the rest:

    <SELECT height=20 name="options">
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    <OPTION>1</OPTION>
    </SELECT>
    Code (markup):
     
    Astroman, Jan 24, 2009 IP
  3. ramkissoon

    ramkissoon Peon

    Messages:
    192
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try using a height in both css and html, if neither works then redo the entire the page html, you have an error.

    CSS - .ClassName select { height: 20px; } (not sure if it will work though, work in earlier html versions)
    HTML - <select height=20 or <select style="height:20px;"

    It should work there.
     
    ramkissoon, Jan 24, 2009 IP
  4. ryandanielt

    ryandanielt Well-Known Member

    Messages:
    1,797
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    185
    #4
    The only real easy way to do it is to use css. Instead of just entering in a number make sure to use PX because that will ensure the size and give you better control of the size.
     
    ryandanielt, Jan 24, 2009 IP
  5. Astroman

    Astroman Well-Known Member

    Messages:
    2,355
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    135
    #5
    The <select height=20 is not pixels, it means 20 rows, 20 results, 20 options etc - so do not put pixels on that.
     
    Astroman, Jan 24, 2009 IP
  6. jediskywalker

    jediskywalker Peon

    Messages:
    122
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    as i see Astroman's solution is good but if you want exact height then control select field font style by css.
    because height of that 20 rows depends on font size
     
    jediskywalker, Jan 24, 2009 IP
  7. ramkissoon

    ramkissoon Peon

    Messages:
    192
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    oh damn! that's right, now I feel stupid. :(

    I had the css right though.
     
    ramkissoon, Jan 25, 2009 IP
  8. cooljeba

    cooljeba Well-Known Member

    Messages:
    570
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    160
    #8
    hi guys.. thanks for your reply.. i tried all that you guys suggested but somehow it doesn't seem to work.. hmm..


    ..:: peace ::..
    Jeba
     
    cooljeba, Jan 27, 2009 IP
  9. Astroman

    Astroman Well-Known Member

    Messages:
    2,355
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    135
    #9
    Can you upload a page somewhere with the code on it so I can see?
     
    Astroman, Jan 27, 2009 IP
    eric.r likes this.