Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Vertical Alignment in divs

Vertical Alignment in divs

Scheduled Pinned Locked Moved Web Development
questionhtml
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brendan Vogt
    wrote on last edited by
    #1

    Hi, I am struggling to have some HTML controls vertical centered in a div tag. I'm not sure what to do? I have a textbox with a button next to it. The button has some padding so it makes it "higher" than the textbox, so instead of the textbox being centered verticlly it is now at the bottom. How do I get it centered to the button? It works fine in Firefox. Brendan

    R M 2 Replies Last reply
    0
    • B Brendan Vogt

      Hi, I am struggling to have some HTML controls vertical centered in a div tag. I'm not sure what to do? I have a textbox with a button next to it. The button has some padding so it makes it "higher" than the textbox, so instead of the textbox being centered verticlly it is now at the bottom. How do I get it centered to the button? It works fine in Firefox. Brendan

      R Offline
      R Offline
      Riaan Booyzen
      wrote on last edited by
      #2

      Hi Brendan, give this a try style="vertical-align:middle;"

      1 Reply Last reply
      0
      • B Brendan Vogt

        Hi, I am struggling to have some HTML controls vertical centered in a div tag. I'm not sure what to do? I have a textbox with a button next to it. The button has some padding so it makes it "higher" than the textbox, so instead of the textbox being centered verticlly it is now at the bottom. How do I get it centered to the button? It works fine in Firefox. Brendan

        M Offline
        M Offline
        Marc Firth
        wrote on last edited by
        #3

        Or alternatively make you div s set width and change its margin to auto. i.e.: This text is centred Or try absolute positioning? Neonlight

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups