troubleshooting Question

Button Won't Center

Avatar of David Schure
David Schure asked on
CSSHTML
4 Comments1 Solution23 ViewsLast Modified:
Trying center a button that is in a div.  It is positioned at the bottom of the div.

It's the send button.
The CSS
.chat_window{
/*height:550px;
width:20%;
float:left;
background:red;
postion:absolute;*/
background-color: #c2eafb;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  -khtml-border-radius: 5px;
  border-radius: 5px;
  height: 500px;
  width: 20%;
  z-index: 9999;
  margin-top: 10px;
  margin-left: 10px;
  position: absolute;
  top:0;
  left:0;
}

.send_me {
   margin: 0 auto;
    padding: 5px 5px 5px 5px;
     position: absolute;
     bottom: 0px;
}
The HTML
<div class="chat_window">
        <div class="chat_title">CHAT WINDOW</div>
        <div class="send_me"><button type="submit" class="btn3" name="submit">Send</button></div>
        </div>
Tried this.  It moved but not to the center.
.send_me {
   right: 50%;
    padding: 5px 5px 5px 5px;
     position: absolute;
     bottom: 0px;
}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros