473,699 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: "simple" buttons - possible without tables?


Hmmm... anyone? :)

Anze
Anze wrote:
Hi!

I am looking for a cleaner solution that would display sth. like this, but
I simply ran out of ideas:
-----
<table border="0" cellpadding="0" cellspacing="0" style="border: 1px solid
#d4d4d4;">
<tr>
<td style="padding: 1px; background-color: #ffffff;">
<input type="submit" value="test 123" style="height: 18px;
background: #e9eaea url(gradient.gi f) left top repeat-x; width: auto;
border: none; padding: 0px 10px;" />
</td>
</tr>
</table>
-----

(I have attached an image - a button of height 18px and auto width that
has a white border of 1px and around it a dark-gray border of 1px. The
background of the button must be a gradient image)

I have tried this:
-----
<div class="button">
<input type="submit" class="button" value="test 123" />
</div>
-----
CSS:
-----
div.button {
display: inline;
border: 1px solid #d4d4d4;
background-color: #ffffff;
padding: 1px;
}
input.button {
background: #e9eaea url(gradient.gi f) left top repeat-x;
padding: 0px;
margin: 0px 10px;
border: none;
height: 18px;
line-height: 18px;
}
-----

If div.button is display:block; then I can't set width to auto. On the
other hand if it is inline I can't specify height.

Of course, I am looking for cross-browser no-hacks solution. Otherwise I'd
rather resort to tables. ;)

Is this possible?

I would appreciate some help.

Thanks,

Anze
Oct 7 '08
10 1761
> You should always set a width on floated items (except if applied
> directly to an image - which has implicit width). W3C's Cascading Style
Sheets, level 2, CSS2 Specifications states:
"A floated box must have an explicit width..."

They do specify it in CSS 2.1. You're looking at CSS 2. The recent
generation of browsers (Firefox, Opera, WebKit) are all aiming for CSS
2.1 plus bits of CSS 3 where they feel like it.
Ben, thank you! I would have used the auto width float DIVs anyway, but I'll
sleep a bit better now. :)

Enjoy,

Anze
Oct 8 '08 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1704
by: Dario de Judicibus | last post by:
I wish to create two simple layouts by using only HTML, CSS and the minimum JavaScript as possible. Layouts should be "elastic" (no fixed widths and heights) and cross-browser enabled. The first one is a non-scrollable page which contains a centered title and a centered division with automatic scrolling on overflow, that is: +---------------------+ | TITLE | | +--------------++ |
1
264
by: Ray Watson | last post by:
Hi all I thought there might be an easy way to have a separate label or picture on web page change as the cursor passes over different buttons on the same web form. In access I could use the "on mouse move" event, but the buttons on web forms don't seem to have that event. Any hints at the process would be greatly appreciated. Cheers
1
2756
by: Richard | last post by:
http://dynamicdrive.com/dynamicindex1/switchmenu.htm I want to add a second level menu item to the existing design. Currently only one level is possible. Item 1 ......link ......link item 2 item 3
2
2062
by: mantas44 | last post by:
Hello all, I have two tables tab_a id(int) tab_b id(int)
19
2496
by: Kramer | last post by:
Hi all, And thank you all so very much for all your recommendations. This is a great group. I ran across a freeware uploader from Toma Web called, Simple FTP 2.0. Anyone have any knowledge about this one. Bill
2
1662
by: Axel Dahmen | last post by:
Hi, I'd like to write a simple COM Automation Server in C# but couldn't find a matching project. I want to have the IDE maintain the IDL and the REG file automatically. Which project should I use to achieve this? TIA, Axel
8
3688
by: Beam_Us_Up_Scotty | last post by:
Hello all, I am trying to write a "simple" animation using C#, and I've tried many things but nothing seems to work for me without leaking memory. Here's a very simple piece of code that uses a timer to set the image of a label from an ImageList every 100ms or so. This is what was being used when I inherited this piece of code, and I thought it was OK, until I changed the size of the label to do animation on a larger piece of screen...
3
3329
by: BKDotCom | last post by:
This has surely been answered somewhere multiple times, but... I'm guessing it's some sort of "bubbling" thing.... <STYLE> ..triggerarea { border:#00C solid 1px; } </STYLE> <UL ID="menu">
5
16705
by: Mark Chambers | last post by:
Hi there, Can anyone explain the following (very) simple scenario. 1) I make an exact copy of my "DataSet" and delete one record from a given table (in the copy) 2) I invoke "DataSet.GetChanges()" on the above copy and pass the results to "DataSet.Merge()" on the original copy 3) If I now inspect the original copy, it shows that the record has *not* been deleted from the table. However, a call to "GetChanges()" does show my
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8617
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7751
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.