TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 01-11-2008, 06:54 PM   #1 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default Button

I wanna code a button, such as in the attached image.

But I can't get it to work :S
So yea, I'm hoping you can fix it

They have rounded corners, just incase you didn't see.
The ends, I've cut out, so they are 2px wide, and 28px high, each.
The actual gradient of the button, is 1px wide, and 28px high.

I want the button to expand in <-> ways, if I write more stuff in the button.

HTML Code:
<div class="button">

	<div class="button-background">

		<img src="left.png" style="float: left; margin: 0;" />
		<div class="button-content">
		Test
		</div>
		<img src="right.png" style="float: right; margin: 0;" />
	
	</div>

</div>
The problem is, how would it be done so that the button expands? Because when I first had no width specified, it expanded all over the screen, even if I had just a little text..

Code:
.button-background {
	width: 100%;
	height: 28px;
	background: url(gradient.png) top left repeat-x;
}

.button {
	
	width: 40px;
	
}

.button-content {
	
	padding-top: 3px;
	margin: 0;
	
}
It works somewhat how I want when I don't have the button-content there. But if I add it, the right end gets pushed down..

And also, I'm assuming that this ain't expanding if I write more text.. :S
Attached Thumbnails
Click image for larger version

Name:	pagenav.jpg
Views:	78
Size:	40.6 KB
ID:	133  
Tanax is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 08:18 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design