styling forms

This is a discussion on "styling forms" within the Starting Out section. This forum, and the thread "styling forms are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Starting Out

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Aug 29th, 2007, 19:58
Junior Member
Join Date: Aug 2007
Location: Markham, Ontario
Age: 55
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Unhappy styling forms

I don't know if this is the right place for this question, but I am working through Eric Meyer on CSS. Every once in a while I come across a statement to add to a project style that doesn't do anything. Most times I find that I have made a minor typo just before or in that statement, but this time I am stuck ... I can't find why it won't work.

I am doing project 7 which is styling a form, and the statement in question (input:focus {background: yellow;} ) is supposed to change the look of the focus element to a bright yellow. Can anyone see what is wrong? Here is the entire code:
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Register to Win!</title>
<style type="text/css" media="screen">
h1 {font-family: sans-serif; border-bottom: 0.1em solid #F33; 
margin-bottom:0;}
td {padding: 0.25em 1px;}
td.lbl {font-weight: bold; text-align: right;}
tr.required td.lbl {background: #FFC; border-left: 0.5em solid red;} 
/* a light red */
td.lbl {background: #CFC; border-left: 0.5em solid green;}
div#submitArea {text-align: center; margin-top: 1em; padding-top: 
1em;}
input:focus {background: yellow;}
</style>
</head>
<body>
<form action="somescript.cgi">
<h1>Register to Win!</h1>
<table cellspacing="0">
<tr class="required">
<td class="lbl">First name:</td>
<td class="inp"><input type="text" name="userFName" size="60" 
maxlength="100"></td>
</tr>
<tr class="required">
<td class="lbl">Last name:</td>
<td class="inp"><input type="text" name="userLName" size="60" 
maxlength="100"></td>
</tr>
<tr class="required">
<td class="lbl">E-mail address:</td>
<td class="inp"><input type="text" name="userEmail" size="60" 
maxlength="100"></td>
</tr>
<tr class="required">
<td class="lbl">State of residence:</td>
<td class="inp"><select name="userState">
<option>Alabama</option>
<option>Alaska</option>
<option>Arizona</option>
<option>Arkansas</option>
<option>California</option>
<option>Colorado</option>
<option>Connecticut</option>
</select>
</td>
</tr>
<tr class="required">
<td class="lbl">Zip code:</td>
<td class="inp"><input type="text" name="userZip" size="20" 
maxlength="20"></td>
</tr>
<tr>
<td class="lbl">Age:</td>
<td class="inp">
<input type="radio" name="userAge" value="18-24">18-24
<input type="radio" name="userAge" value="25-34">25-34
<input type="radio" name="userAge" value="35-49">35-49
<input type="radio" name="userAge" value="50-64">50-64
<input type="radio" name="userAge" value="65+">65+
</td>
</tr>
<tr>
<td class="lbl">Education:</td>
<td class="inp">
<input type="radio" name="userEdu" value="HS">High school
<input type="radio" name="userEdu" value="BABS">BA/BS
<input type="radio" name="userEdu" value="Mast">Masters
<input type="radio" name="userEdu" value="PhD">Ph.D.
<input type="radio" name="userEdu" value="other">other
</td>
</tr>
<tr>
<td class="lbl">Interests:</td>
<td class="inp">
<input type="checkbox" name="userIntr" value="camping">Camping
<input type="checkbox" name="userIntr" value="sports">Sports
<input type="checkbox" name="userIntr" value="movies">Movies
<input type="checkbox" name="userIntr" value="music">Music
<input type="checkbox" name="userIntr" value="books">Books
<input type="checkbox" name="userIntr" value="photo">Photography
<input type="checkbox" name="userIntr" value="other">other
</td>
</tr>
</table>
<div id="submitArea">
<input type="submit" value="Enter me to win!"><br />
Fields highlighted with red labels <strong>must</strong> be filled 
in.
</div>
</form>
</body>
</html>
Please help. I am getting a bit frustrated.

Last edited by karinne; Aug 29th, 2007 at 20:13. Reason: Please use the [ code ] ... [ /code ] tags when displaying code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Aug 29th, 2007, 20:13
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: styling forms

Do you have link?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Aug 29th, 2007, 20:15
Junior Member
Join Date: Aug 2007
Location: Markham, Ontario
Age: 55
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Re: styling forms

This is just a project form the book so I have not published it. Would it help if I uploaded it to my Geocities website and gave you the link?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Aug 29th, 2007, 21:20
Highly Reputable Member
Join Date: Dec 2006
Location: Norwich
Posts: 721
Blog Entries: 4
Thanks: 6
Thanked 2 Times in 2 Posts
Re: styling forms

yep
Last Blog Entry: Whats your Niche? (Jun 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Aug 29th, 2007, 22:22
Junior Member
Join Date: Aug 2007
Location: Markham, Ontario
Age: 55
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Re: styling forms

OK. Here is the link. You can tell how inexperienced I am. I thought all you needed was to see the code that I was using.

http://www.geocities.com/mustardforbrains/index.html

By the way, don't laugh too much at the name in the website address - my kids chose the name (no reflection on my ability to reason) :lolabove:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Aug 30th, 2007, 12:08
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: styling forms

Quote:
Originally Posted by WebMachine View Post
OK. Here is the link. You can tell how inexperienced I am. I thought all you needed was to see the code that I was using.
The code is nice but a link is always preferable so we can actually see what's happening. And when you provide a link, we have access to all your code (except server-side code of course)

So ... your focus thing works fine ... in Firefox and Opera It won't work in IE6 and 7 'cause it doesn't support it

http://www.webdevout.net/browser-support-css

and just scroll down 'til you see :focus
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Aug 30th, 2007, 19:27
Junior Member
Join Date: Aug 2007
Location: Markham, Ontario
Age: 55
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Re: styling forms

Thank you. I knew that there were issues with IE7, but it never occurred to me that this was the case here. Probably that is what was causing my previous problems with the exercises too. I'm going to use Firefox as my default browser from now on, and check IE7 at the end.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
css, forms, help

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with styling my blog please alexgeek Website Planning 12 Sep 23rd, 2007 01:25
<HR> Styling RZX Developer Web Page Design 18 Jul 31st, 2007 22:15
RSS Styling question Daniel Other Programming Languages 4 Apr 8th, 2007 00:28
Styling the <h1> tag. minute44 Web Page Design 10 Aug 14th, 2006 10:12
Styling up with CSS gwx03 Webforumz Suggestions and Feedback 10 Oct 14th, 2003 20:21


All times are GMT. The time now is 11:05.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42