Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-25-2012, 08:49 PM   PM User | #1
charisma44
New Coder

 
Join Date: Sep 2012
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
charisma44 can only hope to improve
buttons side by side

How would I put two or more buttons side by side?

Code:
<p><a href="#" class="css-button">Download</a></p>
Code:
/*css for buttons in destinations starts here*/


a.css-button {
	
		font-size:16px;
		color:#000;
		text-decoration:none;
		display:block;
		width:90px;
		padding:10px;
		border:2px solid #000;
		text-align:center;

		-moz-border-radius:5px;
		-webkit-border-radius:5px;
		-o-border-radius:5px;
		border-radius:5px;
		background:#FFFFFF;
		-webkit-transition: all .4s ease-in-out;
		-moz-transition: all .4s ease-in-out;
		-o-transition: all .4s ease-in-out;
		transition: all .4s ease-in-out;
	}
	a.css-button:hover {
		color:#fff;
		border-color:#000;
		background:#000;
	}
	a.css-button.notransitions {
		-webkit-transition: none;
		-moz-transition: none;
		-o-transition: none;
		transition: none;
	}
/*css for buttons in destinations ends here*/
charisma44 is offline   Reply With Quote
Old 11-25-2012, 09:14 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello chrarisma44,
Why are your anchors wrapped in block level paragraph tags if you want your anchors inline...which is their normal behaviour.

I'm not saying that's invalid, it's just opposite what you're trying to do.

Look at it this way -
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
	margin: 0;
	background: #fc6;
}
#container {
	width: 800px;
	margin: 30px auto;	
	padding: 200px 0 300px;
	background: #fff;
	box-shadow: 0 0 20px #8493A6;
	overflow: auto;
}
</style>
</head>
<body>
    <div id="container">
    <a href="#" class="css-button">Download</a>
    <a href="#" class="css-button">Download</a>
    <a href="#" class="css-button">Download</a>
    <a href="#" class="css-button">Download</a>
    <a href="#" class="css-button">Download</a>
    <!--end container--></div>
</body>
</html>
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 11-25-2012, 09:16 PM   PM User | #3
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Once you do away with the <p> tags, you can add your styling with one small change that I've highlighted in red -
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
	margin: 0;
	background: #fc6;
}
#container {
	width: 800px;
	margin: 30px auto;
	padding: 200px 0 300px;
	background: #fff;
	box-shadow: 0 0 20px #8493A6;
	overflow: auto;
}
a.css-button {
	font-size: 16px;
	color: #000;
	text-decoration: none;
	display: inline-block;
	width: 90px;
	padding: 10px;
	border: 2px solid #000;
	text-align: center;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	-o-border-radius: 5px;
	border-radius: 5px;
	background: #FFFFFF;
	-webkit-transition: all .4s ease-in-out;
	-moz-transition: all .4s ease-in-out;
	-o-transition: all .4s ease-in-out;
	transition: all .4s ease-in-out;
}
a.css-button:hover {
	color: #fff;
	border-color: #000;
	background: #000;
}
a.css-button.notransitions {
	-webkit-transition: none;
	-moz-transition: none;
	-o-transition: none;
	transition: none;
}
</style>
</head>
<body>
    <div id="container">
    <a href="#" class="css-button">Download</a>
    <a href="#" class="css-button">Download</a>
    <a href="#" class="css-button">Download</a>
    <a href="#" class="css-button">Download</a>
    <a href="#" class="css-button">Download</a>
    <!--end container--></div>
</body>
</html>
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 11-25-2012, 09:22 PM   PM User | #4
charisma44
New Coder

 
Join Date: Sep 2012
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
charisma44 can only hope to improve
Yours are vertical, not horizontal lol
charisma44 is offline   Reply With Quote
Old 11-25-2012, 09:26 PM   PM User | #5
charisma44
New Coder

 
Join Date: Sep 2012
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
charisma44 can only hope to improve
Thank you. Got it now.

Last edited by charisma44; 11-25-2012 at 09:34 PM..
charisma44 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:53 AM.


Advertisement
Log in to turn off these ads.