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. Question about empty button top positioning.

Question about empty button top positioning.

Scheduled Pinned Locked Moved Web Development
questionhtmlhelp
2 Posts 2 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.
  • N Offline
    N Offline
    neodeaths
    wrote on last edited by
    #1

    hi i am new to html, i would like to ask in regards to button position in line eg:

    .square{
    height: 50px;
    width: 50px;
    background-color: powderblue;
    }

    a

    for the above simple code snippet, the button top is always not aligned whenever the button have no content. why is this so? and how do i fix this?

    Richard DeemingR 1 Reply Last reply
    0
    • N neodeaths

      hi i am new to html, i would like to ask in regards to button position in line eg:

      .square{
      height: 50px;
      width: 50px;
      background-color: powderblue;
      }

      a

      for the above simple code snippet, the button top is always not aligned whenever the button have no content. why is this so? and how do i fix this?

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Add vertical-align to your CSS rule to fix the problem.

      .square {
      height: 50px;
      width: 50px;
      background-color: powderblue;
      vertical-align: top;
      }

      Original: Edit fiddle - JSFiddle[^] Fixed: Edit fiddle - JSFiddle[^]


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      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