...

View Full Version : Could one element have 2 classes?



Bullschmidt
10-09-2002, 07: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.

adios
10-09-2002, 08:17 AM
http://www.codingforums.com/showthread.php?threadid=6762&highlight=more+than+one+class

Bullschmidt
10-09-2002, 08:27 AM
Sweet!

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

zoobie
10-09-2002, 08: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...

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

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

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

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

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

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

Thanks

MCookie
10-11-2002, 09: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.


<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!--

.add{
width: 150px;
border:1px solid #000;
padding: 3px;
margin: 4px;
}

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

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum