Vertical Alignment and TextBox size

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BeemerBiker
    New Member
    • Jul 2008
    • 87

    Vertical Alignment and TextBox size


    Unaccountably, I cannot set the height of the textbox when using pixels. I wanted the height to match the xx-small font, about "14px", but I found that I had to use "40%" for the height. The "14px" actually worked in the design view, but not at runtime.

    So why was the "px" ignored at runtime, but the % worked fine?
    Is there an equivalent float for the vertical?

    I also plan to use a hovering clickable tooltip (eventually) for the sql filter selections instead of having those start/stop boxes next to the large report buttons. For now, I just want to get it to work and can add the hover stuff later.

    thanks again
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    As far as I know there is no easy way to align things vertically.

    You could do a cheat where you set the line-height the same as the height of the <div> (or Panel).....I don't know if this'll work with your button though.

    All of your questions are better asked in the CSS forum :)

    I've moved your question there.

    PS. How did you set the Height and Width of the TextBoxes?
    Please post your asp code for this.

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      Can this be translated into English...um... I mean HTML? :)

      Actually, can someone show the generated markup without the asp stuff.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        TextBox = <input type='text'>
        Panel = <div>
        Button = <input type='submit'> or <input type='button'>

        Comment

        • David Laakso
          Recognized Expert Contributor
          • Aug 2008
          • 397

          #5
          Put it on a public server and provide a clickable link to it in your post. Hard enough to give an answer seeing an issue, much less wasting everyone's time trying to guess at it.

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Posting this publicly might be a problem for some ASP.NET web application developers. You will probably have a better chance asking for the HTML for the page.

            Comment

            • David Laakso
              Recognized Expert Contributor
              • Aug 2008
              • 397

              #7
              Granted. Please provide the html file and the css file.

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                David, do you know how to vertically align a button within a <div>?

                Comment

                • David Laakso
                  Recognized Expert Contributor
                  • Aug 2008
                  • 397

                  #9
                  Google. Subject line: vertically align a button

                  Comment

                  • Frinavale
                    Recognized Expert Expert
                    • Oct 2006
                    • 9749

                    #10
                    Funny David, thanks a lot, but you could have just said you don't know off the top of your head.

                    Comment

                    • drhowarddrfine
                      Recognized Expert Expert
                      • Sep 2006
                      • 7434

                      #11
                      I know how but no one asked me.

                      Comment

                      • Frinavale
                        Recognized Expert Expert
                        • Oct 2006
                        • 9749

                        #12
                        I've always had problems with vertical alignment.
                        I've done everything from set the line-height to the height of the parent element...to placing the content in a table and using the v-align property....to using JavaScript...
                        Actually...I don't think I've used the "vertical-align" style on an element yet (which happens to be the most recommended solution in a google search for vertically aligning ...strange)

                        What would you recommend Doc?

                        Comment

                        • David Laakso
                          Recognized Expert Contributor
                          • Aug 2008
                          • 397

                          #13
                          Originally posted by David Laakso
                          Google. Subject line: vertically align a button
                          You asked an opened question. I pointed you to an open ended answer. If you would like a specific answer to a specific question then you'll have to do better than write a cursory question that begged the answers: Careful my friend! Or, I beg your pardon?

                          Comment

                          • Frinavale
                            Recognized Expert Expert
                            • Oct 2006
                            • 9749

                            #14
                            My question:
                            Originally posted by Frinavale
                            David, do you know how to vertically align a button within a <div>?
                            Was in reference to the original question:
                            Originally posted by BeemerBiker
                            Is there an equivalent float for the vertical?
                            I figured that was obvious since it's in the same thread...I guess that's just how my mind works. It seems pretty specific to me.

                            Also, you have to keep in mind that the OP is not familiar with CSS at all. In fact, the OP didn't even know that his problem was CSS related.... seeing as I'm not an expert with CSS either, you're probably going to see some "open-ended", simple questions because we don't know what we are looking for.

                            Comment

                            • drhowarddrfine
                              Recognized Expert Expert
                              • Sep 2006
                              • 7434

                              #15
                              A simple example:
                              Code:
                              <style type="text/css">
                              div{height:200px;width:200px;outline:1px solid}
                              input{position:relative;top:50%}
                              </style>
                              
                              <div>
                              <input type="radio">
                              </div>
                              There are other ways if the simple example doesn't fit.

                              Comment

                              Working...