Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
2 buttons next to each other
Old 07-22-2008, 10:50 AM 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
Hi, I have created an image in Photoshop of a sidebar I want to use on my new website, you can see the image below:



Ok, I have started coding it with notepad ++ (saving up to buy dreamweaver) and I have got this far:



But as you can see I can't get the two buttons at the bottom to be next to each other like on the image, so does anyone know how I would do this?

This is the css I am using:

Code:
#navigationbuttons ul
{
    width: 100%;
    margin: 0;
    padding: 0;
    border-top: 1px solid #fffff;
}

#navigationbuttons ul li
{
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #fff;
    list-style: none;
          background-color: #fff;
}

#navigationbuttons ul li a
{
    display: block;
    margin:    29px 0 0 0;
    padding: 0 0 0 48px;
    font-size: 0.9em;
    font-weight: bold;
    text-decoration: none;
    text-align: left;
    line-height: 31px;
    background-position: center left;
    background-repeat: no-repeat;
}

#navigationbuttons ul li a:link,
#navigationbuttons ul li a:visited
{
    color:                        #000;
}

#navigationbuttons ul li a:active,
#navigationbuttons ul li a:hover
{
    color: #FFF;
    background-position: center left;
    background-repeat: no-repeat;
}

#navigationbuttons ul li a#signup { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/signup.jpg"); }
#navigationbuttons ul li a#signup:hover { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/signuph.jpg"); }
#navigationbuttons ul li a#moreinfo{ background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/moreinfo.jpg"); }
#navigationbuttons ul li a#moreinfo:hover { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/moreinfoh.jpg"); }
and the html:

Code:
                                  <div id="navigationbuttons">

                    <ul>
                        <li><a id="signup" href="/">&nbsp;</a><a id="moreinfo" href="/">&nbsp;</a></li>
                    </ul>

                </div>
Also when you hover the buttons, they change to a different button

So does anyone know how I can make the buttons be next to each other like on the image I created in Photoshop

Thanks alot
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-22-2008, 11:05 AM Re: 2 buttons next to each other
MatrixIT's Avatar
Skilled Talker

Posts: 85
Name: Dan
Trades: 0
OK, firstly I wouldn't use nbsp's to seperate content, stick to CSS (perhaps margins)

Secondly, I would put each link in a seperate <li> tag then apply 'display:inline' to the li's in your CSS

hope that helps (/works lol)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
MatrixIT is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 11:09 AM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
Hi Matrix, I did what you said and now the buttons have disappeared completly?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 11:11 AM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
Here is the html code:

Code:
                                  <div id="navigationbuttons">

                    <ul>
                        <li><a id="signup" href="/"></a></li>
                        <li><a id="moreinfo" href="/"></a></li>
                    </ul>

                </div>
And the css code:

Code:
#navigationbuttons ul li
{
    margin: 10px;
    padding: 0;
    border-bottom: 1px solid #fff;
    list-style: none;
    background-color: #fff;
    display: inline;
}
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 11:53 AM Re: 2 buttons next to each other
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you might just need some anchor text to make the links show up

Using a list for two buttons is a little overkill though.


CSS
Code:
#navigationbuttons {
	width:250px;
	height:35px;
}
#navigationbuttons a {
    display: block;
	float:left;
	width:40%;
	height:100%;
	color:white;
	text-align:center;
	background-color:black;
	line-height:2em;
	font-size:1em;
}
#moreinfo {
	clear:right;
	margin:0 10px;
}
HTML Code:
<div id="navigationbuttons">
	<a id="signup" href="/">Sign Up</a>
    <a id="moreinfo" href="/">More Info</a>
</div>			
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-22-2008, 12:06 PM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
Hi Chris, I followed your instructions and this is what it came out like:

__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 12:24 PM Re: 2 buttons next to each other
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
need a URL not a screenshot.

http://www.candsdesign.co.uk/demo/temp1.asp
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-22-2008, 03:33 PM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
I'm sorry, I'm at work and I am only allowed to do it on my desktop, but yours may work, but its not what I am after.

I have the two images which I wanted and when you hover over them, the image changes, but I just need them to be on the same row

Can anyone help please?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 03:43 PM Re: 2 buttons next to each other
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Not a problem, it's the same principle, just a bit of a change in the CSS

just attach the images to a post and we have something to work with.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-23-2008, 06:23 AM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
Ok thanks for this. I have uploaded the image as an attachment to this post and this image is what I want my sidebar to look like.

It won't let me attach a firefox extension, so this is the code I am using:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>MoneyExtra.com</title>

<META name="DESCRIPTION" CONTENT=""/>
<META name="KEYWORDS" CONTENT="" />

<style type="text/css">
<!--
body {
    padding-top: 3px;
    padding-left: 8px;
    margin-top: 0;
    width: 365px;
    height: 638px;
          font-size: 11px;
          font-family: Verdana, Arial, Helvetica, sans-serif;
}
    
.header {
    padding-top: 0;
    margin-top: 0;
    width: 365px;
}

.main {
    padding-top: 0;
    margin-top: 0;
    width: 365px;
}

.main p {
padding: 0px 8px;
margin: 0;
line-height: 130%; 
}

#google {
float: right; 
}

#navigationmain ul
{
    width: 100%;
    margin: 0;
    padding: 0;
    border-top: 1px solid #fff;
}

#navigationmain ul li
{
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #A0AFB6;
    list-style: none;
           background-color: #A0AFB6;
}

#navigationmain ul li a
{
    display: block;
    margin: 2px 0 0 0;
    padding: 0 0 0 48px;
    font-size: 0.9em;
    font-weight: bold;
    text-decoration: none;
    text-align: left;
    line-height: 31px;
    background-position: center left;
    background-repeat: no-repeat;
}

#navigationmain ul li a:link,
#navigationmain ul li a:visited
{
    color: #000;
}

#navigationmain ul li a:active,
#navigationmain ul li a:hover
{
    color: #FFF;
    background-position: center left;
    background-repeat: no-repeat;
}

#navigationmain ul li a#youronlineifa { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/icon.jpg"); }
#navigationmain ul li a#youronlineifa:hover  { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/iconh.jpg"); }
#navigationmain ul li a#track { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/icon.jpg"); }
#navigationmain ul li a#track:hover  { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/iconh.jpg"); }
#navigationmain ul li a#consolidate{ background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/icon.jpg"); }
#navigationmain ul li a#consolidate:hover { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/iconh.jpg"); }
#navigationmain ul li a#savings { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/icon.jpg"); }
#navigationmain ul li a#savings:hover { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/iconh.jpg"); }

#navigationbuttons ul
{
    width: 100%;
    margin: 0;
    padding: 0;
    border-top: 1px solid #fff;
}

#navigationbuttons ul li
{
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #fff;
    list-style: none;
           background-color: #fff;
           display: inline;
}

#navigationbuttons ul li a
{
    display: block;
    margin: 29px 0 0 0;
    padding: 0 0 0 48px;
    font-size: 0.9em;
    font-weight: bold;
    text-decoration: none;
    text-align: left;
    line-height: 31px;
    background-position: center left;
    background-repeat: no-repeat;
}

#navigationbuttons ul li a:link,
#navigationbuttons ul li a:visited
{
    color: #000;
}

#navigationbuttons ul li a:active,
#navigationbuttons ul li a:hover
{
    color: #FFF;
    background-position: center left;
    background-repeat: no-repeat;
}

#navigationbuttons ul li a#signup { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/signup.jpg"); }
#navigationbuttons ul li a#signup:hover { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/signuph.jpg"); }
#navigationbuttons ul li a#moreinfo{ background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/moreinfo.jpg"); }
#navigationbuttons ul li a#moreinfo:hover { background-image: url("file:///C:/Documents%20and%20Settings/2010199/Desktop/moreinfoh.jpg"); }
    
-->
</style>
</head>
<body>

<div class="header">
<img src="file:///C:/Documents%20and%20Settings/2010199/Desktop/header.jpg" /><br />
</div>

<div class="main">
<img src="file:///C:/Documents%20and%20Settings/2010199/Desktop/google.jpg" id="google" /><br />
<p>If you sign up to My Moneyextra.com<br />not only would you be able to keep up<br />to date with insurance news but you<br />would also be able to take advantage<br />of the following:</p><br /><br />
</div>

                  <div id="navigationmain">

                    <ul>
                        <li><a id="youronlineifa" href="/">Your online IFA</a></li>
                        <li><a id="track" href="/">Track your stocks and shares.</a></li>
                        <li><a id="consolidate" href="/">Consolidate debt</a></li>
                        <li><a id="savings" href="/">Savings Advice</a></li>

                    </ul>

                </div>
                
                                  <div id="navigationbuttons">

                    <ul>
                        <li><a id="signup" href="/">&nbsp;</a><a id="moreinfo" href="/">&nbsp;</a></li>
                    </ul>

                </div>

</body>

</html>
If you save that and open it with your browser, you can see what the outcome is and I also uploaded the other images.

Thanks
Attached Images
File Type: jpg MXUI.jpg (65.4 KB, 1 views)
File Type: jpg icon.jpg (1.2 KB, 10 views)
File Type: jpg header.jpg (8.2 KB, 0 views)
File Type: jpg iconh.jpg (1.4 KB, 8 views)
File Type: jpg signup.jpg (3.5 KB, 0 views)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-23-2008, 06:24 AM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
More image attachmets and the "google.jpg" was too big for an attachment, so I uploaded it onto imageshack: http://img73.imageshack.us/img73/6383/googleki3.jpg

Thanks again
Attached Images
File Type: jpg moreinfo.jpg (3.7 KB, 0 views)
File Type: jpg moreinfoh.jpg (4.0 KB, 0 views)
File Type: jpg signuph.jpg (3.7 KB, 0 views)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by Danaldinho; 07-23-2008 at 06:43 AM..
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-23-2008, 06:56 AM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
In fact, forget them posts (sorry) I added a page quickly on my personal site: http://www.danielmousdell.com/moneyextra.html
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-23-2008, 06:57 AM Re: 2 buttons next to each other
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
If you save that and open it with your browser, you can see what the outcome is and I also uploaded the other images.
Nope that wont work.
Be aware that your HTML code and CSS code references the images as files in your "My Documents" folder so will not work when uploaded.

ALSO you are using an XHTML doctype so this ->
<META name="DESCRIPTION" CONTENT=""/>

should be in lower case.

Not sure why you need to use images as buttons when the same thing can be recreated with CSS (saves a bit of bandwidth as well)

anyhoo I'll be back.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-23-2008, 07:02 AM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
Please read the post above mate, if you can

I'm sorry
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-23-2008, 07:55 AM Re: 2 buttons next to each other
MatrixIT's Avatar
Skilled Talker

Posts: 85
Name: Dan
Trades: 0
hang on, have you tried using float:left?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
MatrixIT is offline
Reply With Quote
View Public Profile
 
Old 07-23-2008, 07:58 AM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
Yep, no luck
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-23-2008, 10:16 AM Re: 2 buttons next to each other
MatrixIT's Avatar
Skilled Talker

Posts: 85
Name: Dan
Trades: 0
put them in SEPERATE <li> tags, and then display them inline. I think that should work
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
MatrixIT is offline
Reply With Quote
View Public Profile
 
Old 07-23-2008, 10:17 AM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
Nope, that just removes them or makes them invisible
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-23-2008, 11:06 AM Re: 2 buttons next to each other
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
floats are actually the way to do this. Only a very simple change was needed

http://www.candsdesign.co.uk/demo/danaldinho/

Change this code #navigationbuttons ul li a to
Code:
#navigationbuttons ul li a
{
	display: block;
	margin: 29px 3px 0 0;
	font-size: 0.9em;
	font-weight: bold;
	text-decoration: none;
	text-align: left;
	line-height: 31px;
	background-position: center left;
	background-repeat: no-repeat;
	float:left;
	width:120px;
	height:31px;
}
You do need to adjust your overall widths for IE though.

Quote:
Nope, that just removes them or makes them invisible
This is because when you float an element you have to give it a width (and height if it just holds a background image or colour)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-23-2008, 11:13 AM Re: 2 buttons next to each other
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
argh thanks chris, so thats why, but there is a problem

when you go to: http://www.danielmousdell.com/moneyextra.html

its still the same and I changed the css code

i'm using firefox too atm, i will edit for IE as soon as I'm happy with it in ff

Thanks again
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to 2 buttons next to each other

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53662 seconds with 13 queries