|
|
|
|
Thread title: Help With Centering CSS Button |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
12-14-2012, 04:02 PM
|
#1
|
Status: I'm new around here
Join date: Jun 2012
Location: accra
Expertise: design, writing
Software: photoshop, alleycode, GIMP,
Posts: 13
|
Help With Centering CSS Button
I need help centering a CSS Button.: I tried using the display tag but instead it extends the width of the button. Please help!
|
|
12-14-2012, 04:53 PM
|
#2
|
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
Posts: 3,164
|
add text-align:center; to the button's container element.
|
|
12-14-2012, 08:22 PM
|
#3
|
Status: I'm new around here
Join date: Jun 2012
Location: accra
Expertise: design, writing
Software: photoshop, alleycode, GIMP,
Posts: 13
|
Still no change..The button is still sitting in the left corner.
|
|
12-14-2012, 09:32 PM
|
#4
|
Status: I'm new around here
Join date: Jun 2012
Location: accra
Expertise: design, writing
Software: photoshop, alleycode, GIMP,
Posts: 13
|
Just to hlp you out here is the code for the button:
.button {margin:0 auto;
font-family: Arial;
color: #ffffff;
font-size: 20px;
padding: 10px;
text-decoration: none;
text-align:center;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-webkit-box-shadow: 0px 1px 3px #666666;
-moz-box-shadow: 0px 1px 3px #666666;
text-shadow: 1px 1px 3px #666666;
border: solid #003366 2px;
background: -webkit-gradient(linear, 0 0, 0 100%, from(#42aaff), to(#003366));
background: -moz-linear-gradient(top, #42aaff, #003366);}
.button:hover {background: #42aaff;}
|
|
12-15-2012, 07:04 AM
|
#5
|
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
Posts: 3,164
|
add display:block; to .button. Margin won't work otherwise.
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|