Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use custom class for fieldset?

Status
Not open for further replies.

basball

Technical User
Dec 18, 2002
192
US
what is the correct method for using a custom class to define style for fieldset? code below isn't working.
am i stuck using .legend, don't want to place a style on an actual tag.

thanks.


<style type="text/css">
<!--
.test {
height: 50px;
width: 50px;
}
-->
</style>
</head>

<body>

<fieldset>
<p class="test"><legend>I replace the line</legend>
</fieldset>

</body>
</html>
 
Have you tried putting the class="test" on the legend instead of the P?

Just a thought... I haven't tried it, so not sure if it will work or not.

Dan
 
The way you did it is ok. The problem is where you applied the class. If you want to apply the class to the fieldset element, just do it:

<fieldset class="test">
...
</fieldset>

If you want to apply the rule to all fieldsets, you can try:
Code:
<style type="text/css">
  fieldset {
    width: 50px;
    height: 50px;
  }
</style>

<fieldset>
 ...
</fieldset>
 
Also... don't put anything between FIELDSET and LEGEND.

If you want to redefine LEGEND inside customized FIELDSET, use cascading:
Code:
.test legend
{	background-color: navy;
	color: white;
	font-family: Verdana;
	font-size: 9pt; 
	border: solid gray 1px;
	padding: 2px 6px 2px 6px;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top