Help My good fellows please!

im trying to tidying up label elemts with css but it doesn’t work

1st Style.css

orm.contact label {
font-weight: label;
font-size: small;
color: blue;
}

form.contact label. fixedwidth {
display: block;
width: 240;
float: left;
}

2nd contact.html <div>
<label for=“contactname” class=“fixedwidth”>Contact
Name</label>
<input type=“text” name=“contactname” id=“contactname”/>
</div>
<div>
<label for=“telephone” class=“fixedwidth”>Telephone
Number</label>
<input type=“text” name=“telephone” id=“telephone”/>
</div>
<div>
<label for=“email” class=“fixedwitdh”>Email Address</label>
<input type=“text” name=“email” id=“email”/>
</div>
<div>
<label for=“eventname” class=“fixedwidth”>What’s the event
called?</label>
<input type=“text” anme=“eventname” id=“eventname”/>
</div>
<div>
<label for=“eventdate” class=“fixedwidth”>When’s the event
happening?</label>
<input type=“text” name=“eventdate” id=eventdate’/>
</div>

what did i do wrong in here?

CSS:

  1. You’re missing an ‘f’ on the first line.
  2. I guess there shouldn’t be a space between ‘label.’ and ‘fixedwidth’

HTML:
Where is the <form> tag?

This also doesn’t mean anything:

font-weight: label; 

You can have

font-weight: bold;

or

font-weight: normal;

You have loads of typos in both of the CSS examples. I assume you are now at [p 278] in which case:

form.contact label.fixedwidth {
display: block;
width: 240px;
float: left;
}

Is what you should be writing.

As for the other part:
[FONT=Courier New]
form.contact label {
font-weight: bold;
font-size: small;
color: blue;
}

[/FONT]Is what it asked you to write.

[FONT=Courier New]

[/FONT]

ok im trying to put form button in my form but it won’t work for some reason.
here is my code

form.contact .buttonarea {
text-align: center;
padding: 4px;
background-color: #0066ff;

}

is that ok?

im trying to create a special area for buttons. but it’s not working does any one know y?

form.contact .buttonarea {
text-align: center;
padding: 4px;
background-color: 0066ff;
}

Without the associated HTML, there’s no way to check if that CSS is targeting the elements appropriately, so post that too. :slight_smile:

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1-strict.dtd"&gt; 
&lt;html xmlns="http://www.w3.org/xhtml". 
  &lt;head&gt; 
    &lt;title&gt;Contact Us at Bubble Under&lt;/title&gt; 
    &lt;meta http-equiv="Content-Type" 
        content=text/html; charset=utf-8"/&gt; 
  &lt;link href="style1.css" rel="stylesheet" type="text/css"/&gt;
  &lt;/head&gt; 
  &lt;body&gt; 
  &lt;div id="header"&gt;
    &lt;div id="sitebranding"&gt;
      &lt;h1&gt;BubbleUnder.com&lt;/h1&gt;
    &lt;/div&gt; 
    &lt;div id="tagline"&gt; 
      &lt;p&gt;Diving club for the south-west UK-let's make a 
        splash!&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt; &lt;!--end of header div --&gt;
  &lt;div id="navigation"&gt; 
    &lt;ul&gt; 
      &lt;li&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="about.html"&gt;About Us&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="events`.html"&gt;Club Events&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="contact.html"&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="gallery.html"&gt;Image Gallery&lt;/a&gt;&lt;/li&gt;
    &lt;/lu&gt;
  &lt;/div&gt; &lt;!-- end of navigation div--&gt; 
  &lt;div id="bodycontent"&gt;
    &lt;h2&gt;Contact Us&lt;/h2&gt;
    &lt;p&gt;To let us know about a forthcoming dive event, please use
        the form below.&lt;/p&gt; 
    &lt;form action="" method="post" class="contact"&gt; 
      &lt;fieldset&gt; 
        &lt;legend&gt;Tell us about a Dive Event&lt;/legend&gt; 
        &lt;div&gt; 
          &lt;label for="contactname" class="fixedwidth"&gt;Contact 
              Name&lt;/label&gt; 
          &lt;input type="text" name="contactname" id="contactname"/&gt; 
        &lt;/div&gt;
        &lt;div&gt; 
          &lt;label for="telephone" class="fixedwidth"&gt;Telephone 
              Number&lt;/label&gt; 
          &lt;input type="text" name="telephone" id="telephone"/&gt; 
        &lt;/div&gt; 
        &lt;div&gt; 
          &lt;label for="email" class="fixedwidth"&gt;Email Address&lt;/label&gt; 
          &lt;input type="text" name="email" id="email"/&gt; 
        &lt;/div&gt; 
        &lt;div&gt; 
          &lt;label for="eventname" class="fixedwidth"&gt;What's the event
              called?&lt;/label&gt; 
          &lt;input type="text" anme="eventname" id="eventname"/&gt; 
        &lt;/div&gt; 
        &lt;div&gt; 
          &lt;label for="eventdate" class="fixedwidth"&gt;When's the event 
              happening?&lt;/label&gt; 
          &lt;input type="text" name="eventdate" id=eventdate'/&gt; 
        &lt;/div&gt;  
        &lt;div&gt; 
         &lt;label for="region" class="fixedwidth"&gt; What region is the event 
             in?&lt;/label&gt; 
         &lt;select name="region" id="region"&gt; 
           &lt;option&gt;South-west&lt;/option&gt; 
           &lt;option&gt;South-east&lt;/option&gt; 
           &lt;option&gt;Midlands&lt;/option&gt; 
           &lt;option&gt;Central&lt;/option&gt; 
           &lt;option&gt;London&lt;/option&gt;
           &lt;option&gt;East&lt;/option&gt; 
           &lt;option&gt;North&lt;/option&gt; 
           &lt;option&gt;Scotland&lt;/option&gt; 
           &lt;option&gt;Northern Ireland&lt;/option&gt; 
           &lt;option&gt;Wales&lt;/option&gt; 
           &lt;option&gt;International (see details below)&lt;/option&gt; 
         &lt;/select&gt; 
      &lt;/div&gt; 
       &lt;div&gt; 
      &lt;p&gt;Please provide any other details you think will be useful to 
          us in the text area below (it may save us calling or 
          emailing you, and help avoid delays).&lt;/p&gt; 
      &lt;label for="details class="fixedwidth"&gt;More details (as much as 
          you think we'll need!)&lt;/label&gt; 
      &lt;textarea id="details" name="details" cols="30" 
         rows="7"&gt;&lt;/textarea&gt; 
    &lt;/div&gt;
    &lt;div&gt;
      &lt;p&gt;If we need to call you back gor any more info, what would be
          the best time to call you on number supplied?&lt;/p&gt; 
      &lt;input type="radio" name="timetocall" id="morning" 
          value="Morning"/&gt;
      &lt;label for="morning"&gt;In the morning&lt;/label&gt; 
      &lt;br/&gt; 
      
      &lt;input type="radio" name="timetocall" id="afternoon" 
          value="Afternoon"/&gt;
      &lt;label for="afternoon"&gt;In the afternoon&lt;/label&gt; 
      &lt;br/&gt; 

      &lt;input type="radio" name="timetocall" id="evening" 
          value="Evening"/&gt; 
      &lt;label for="evening"&gt; In the evening&lt;/label&gt;
      &lt;br/&gt; 

      &lt;input type="radio" name="timetocall" id="never" value="never" 
          checked="checked"/&gt; 
      &lt;label for="never"&gt; No calls please&lt;/label&gt; 
    &lt;/div&gt; 
    &lt;div&gt; 
      &lt;p&gt;Bubble Under may share information you give us here with 
          other like-minded people or web sites to promote the event. 
          Please confrim if you are happy for us to do this.&lt;/p&gt; 
      &lt;input type="checkbox" name="publicize" id="publicize" 
          checked="checked"/&gt; 
      &lt;label for="publicize"&gt;I am happy for this event to be 
          publicized outside of and beyond BubbleUnder.com, where 
          possible&lt;/label&gt; 
    &lt;/div&gt; 
       &lt;/fieldset&gt; 
    &lt;/form&gt; 
    &lt;p&gt;If you need to get in touch urgently, please call Bob 
        Dobalina on 01793 641207. For anything else, please &lt;a 
        href="mailto:bob@bubbleunder.com"&gt;drop us a line by 
        email&lt;/a&gt;.&lt;/p&gt; 
    &lt;div&gt; 
      &lt;p&gt;Please provide any other details you think will be useful to 
          us in the text area below (it may save us calling or 
          emailing you, and help avoid delays).&lt;/p&gt; 
                 
    &lt;/div&gt; &lt;!-- end of bodycontent div --&gt;
  &lt;/body&gt; 
&lt;/html&gt;

this is the html for contact. thank you for helping

There’s no class=“buttonarea” in your HTML, so the styles you posted in your first post can’t apply to anything. What element(s) did you want it to apply to?

You styles are saying:

Look for a form element with a class of “contact”, and inside that form find elements with the class “buttonarea”, and apply these styles to them.

Also, make sure to fix this line at the top of your HTML:

<html xmlns="http://www.w3.org/xhtml". 

It shouldn’t have a period at the end:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

I assume you are talking about [p288] and if so then that CSS is correct but you might have a typo somewhere else in the CSS or XHTML.

[note: two threads merged, as they both ask the same question. :slight_smile: ]

Yes, the merge confused me but the following should go just before the closing fieldset, i.e. </fieldset>

<div class="buttonarea">
  <input type="submit" value="Send Us the Info" />
</div>

You also have some other typos within the markup like LU instead of UL.

Plus some missing quotes for example: id=eventdate’ should be: id=“eventdate” and <label for="details class=“fixedwidth”> should be: <label for=“details” class=“fixedwidth”> so they’ll need fixing too.