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 04-24-2012, 12:51 PM   PM User | #1
Yusuf
New Coder

 
Join Date: Mar 2012
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Yusuf is an unknown quantity at this point
Problem with aligning css button

I've two buttons on my form. I should align in vertically on same line but, one seems to be above the other one.
Here is the css code

Code:
.submit input
{
margin-left: 12.5em;
}
.submit input
{
color: #000;
background: #ffa20f;
border: 3px outset #d7b9c9
}
.reset input
{
margin-left: 25em;
}
.reset input
{
color: #000;
background: #ffa20f;
border: 3px outset #d7b9c9
}
I've attached the picture of the button.
Attached Thumbnails
Click image for larger version

Name:	button.jpg
Views:	31
Size:	13.6 KB
ID:	11086  
Yusuf is offline   Reply With Quote
Old 04-24-2012, 01:48 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Here is the css code
Some CSS alone without the corresponding HTML is pretty useless. Please post the HTML or a link to your page.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 04-24-2012, 04:11 PM   PM User | #3
Yusuf
New Coder

 
Join Date: Mar 2012
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Yusuf is an unknown quantity at this point
Code:
<p class="submit"><input type="submit" value="Submit" />
<p class="reset"><input type="reset" value="Reset" />
HTML code for button
Yusuf is offline   Reply With Quote
Old 04-24-2012, 04:32 PM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Code:
.reset input
{
margin-left: 25em;
}
The second input element has a 25em; margin-left applied to it.

PS: Validate your markup using http://validator.w3.org/
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 04-24-2012, 04:35 PM   PM User | #5
Yusuf
New Coder

 
Join Date: Mar 2012
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Yusuf is an unknown quantity at this point
What should be instead of the 25em; margin-left to align it vertically on same line?
Yusuf is offline   Reply With Quote
Old 04-24-2012, 04:44 PM   PM User | #6
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Code:
.reset input
{
margin-left: 12.5em;
}
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 04-24-2012, 05:11 PM   PM User | #7
Yusuf
New Coder

 
Join Date: Mar 2012
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Yusuf is an unknown quantity at this point
Sorry I mean horizontally on same line?

margin-right?

smething like that?
Yusuf is offline   Reply With Quote
Old 04-25-2012, 07:34 AM   PM User | #8
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
horizontally on same line?
Then remove those two <p> tags
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 04-25-2012, 12:56 PM   PM User | #9
Yusuf
New Coder

 
Join Date: Mar 2012
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Yusuf is an unknown quantity at this point
Yeah horizontally on same line, but if I remove the <p>, find it attached in the picture below

I don't want it like this, I want it to align just below the textbox above it.
Attached Thumbnails
Click image for larger version

Name:	Untitled.jpg
Views:	9
Size:	18.6 KB
ID:	11091  
Yusuf 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 08:28 AM.


Advertisement
Log in to turn off these ads.