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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple forms on a page w/ different CSS for each 1

Status
Not open for further replies.

mkrausnick

Programmer
Apr 2, 2002
766
US
I'm learning about css-styled forms from the excellent site Design Meltdown. I want to have a data entry form on a page on which there is already a site search form in tne navigation bar.

I get that I need to enclose the data entry form in a DIV with a class selector (<div class="dataentry"> for example). My question is what's the CSS syntax for designating that the CSS FORM declaration should apply only to forms with a classname of "dataentry"?

Thanks greatly,

Mike Krausnick
Dublin, California
 
You don't need to put the form in a <div>, just give the form a class:
Code:
<form class="dataentry" action="/cgi-bin/xxx.pl">
Then you can style the form and its contents like this:
Code:
form.dataentry {
   border: 1px solid black;
}

form.dataentry input {
   color: red;
}

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Code:
 .dataentry {
...}
references a class in your stylesheet.


Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
<sound of hand slapping head> Duh! of course. I was soooo close. Thanks, Chris, for the clear concise explanation. Have a star!

Mike Krausnick
Dublin, California
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top