Reputation: 4306
Is it possible to create a somewhat irregular shaped button.
My button has the following css which makes it a simple rectangle.
.btnclass {
width:100;
height:40;
}
but it want to make look more like this:
______________________
| ___________|
| |___________
|______________________|
Any clever ideas to accomplish this with CSS?
Upvotes: 0
Views: 3454
Reputation: 2919
Go with an image button. <input type="image" ... />
or <button><img src="" /></button>
If not, the suggestions below aren't optimal but that's because an image is probably the most optimal solution.
Setting a background-image with the desired shape. I think this is the most pure solution so go for this.
background-image: url(whole-image.png);
Setting a background color and a small background-image located at the top right corner. The solution is something similar to the "rounded-corner-hack" out there.
background: #<button-color> url(small-image.png) top right no-repeat;
Upvotes: 0
Reputation: 327
Not really without a bunch of CSS hackery, your best bet is to use images.
If your attempting to do so for form buttons look at using the following
<input type="image" src="image_path.png" alt="image description" />
Upvotes: 0
Reputation: 10490
I don't think you can, your better off using an image that's shaped as you want
Upvotes: 1