View Full Version : Could one element have 2 classes?

10-09-2002, 06:54 AM
Could one element have 2 classes such as this?:
class="bold" class="noprint"

And if not what else could be done to achieve the same thing?

Thanks in advance.

10-09-2002, 07:17 AM

10-09-2002, 07:27 AM

10-09-2002, 10:27 AM
Be careful, Win/IE5 only sees the last class.

10-09-2002, 07:16 PM
Uh oh...I saw that thread and have been using the technique. Before, I think I used <input type=button class=but style="color:red" value=blah> which seemed to work fine. Now, I may have to go back and redo it my old way. Maybe someone could double check my old method...

10-11-2002, 07:28 AM
So, without starting a new thread, is the below going to work with NS4+ and IE4+? Thanks

input {font:bold 14px tahoma; width:85px; height: 23px; background-color: #000000}
<input type="button" name="but" style="color:#ff0000" value="Blah">

Roy Sinclair
10-11-2002, 06:17 PM
Netscape 4 ignores those styles.

10-11-2002, 08:09 PM
So, this is stil;l good in all 4+ browsers?

<style type="text/css">
.button {font:bold 14px tahoma; color:red; background-color:black;width: 85px; height: 25px}

<input type="button" class="button" value="Click here>


10-11-2002, 08:45 PM
Zoobie, it looks like you're mixing things up. You can always use a class and a style attribute in a tag like <img class="image" style="margin:10px;" .. etc .. >

The question was about two classes like in the example below. Win/IE5 only sees the second classes 'yellow', 'blue', 'green'. So, in Win/IE5, those divs would not have a width, no border and no padding and margin.

<style type="text/css">

width: 150px;
border:1px solid #000;
padding: 3px;
margin: 4px;

.yellow {background:#ff0; }
.blue {background:#00ff; }
.green {background:#090; }

<body bgcolor="#FFFFFF">
<div class="add yellow">Yellow background.</div>
<div class="add blue">Blue background.</div>
<div class="add green">Green background.</div>

And by the way, styling input buttons in NN4.. don't think so..

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum