Need advice on code

S

shapper

Hello,

I have a page with the following content and using the following tags:

Title <h1>
Description <span>
Text <p>
Form Header <h2>
Form <ul> (the form inputs and buttons are
inside the <li> tags)
Text <p>

My question is:
Is there any reason to put my FormHeader and Form wrapped around
inside a div?

Thanks,
Miguel
 
A

Adrienne Boswell

Gazing into my crystal ball I observed shapper <[email protected]>
writing in @e6g2000prf.googlegroups.com:
Hello,

I have a page with the following content and using the following tags:

Title <h1>
Description <span>
Text <p>
Form Header <h2>
Form <ul> (the form inputs and buttons are
inside the <li> tags)
Text <p>

My question is:
Is there any reason to put my FormHeader and Form wrapped around
inside a div?

Thanks,
Miguel

Why are you using this kind of markup? Use the correct element for the
job:

<h1>Page Title</h1>
<p>Use the form to send information.</p>
<form method="post" action="somescript">
<fieldset><legend>Form Title</legend>
<label for="field1">Field1 </label> <input type="text" name="field1"
id="field1" value="initial value"><br>
<label for="field2">Field2 </label> <input type="text" name="field2"
id="field2" value="initial value"><br>
<input type="submit" value="Submit">
</fieldset>
</form>

Using this kind of markup, you can style the elements any way you wish.
 
D

DocuMaker

Hello,

I have a page with the following content and using the following tags:

Title <h1>
Description <span>
Text <p>
Form Header <h2>
Form <ul> (the form inputs and buttons are
inside the <li> tags)
Text <p>

My question is:
Is there any reason to put my FormHeader and Form wrapped around
inside a div?

Thanks,
Miguel

I can't think of a reason since forms automatically break onto a new
line. Unless forms can accept styles - then no.
 
C

Chaddy2222

Gazing into my crystal ball I observed shapper <[email protected]>
writing in @e6g2000prf.googlegroups.com:










Why are you using this kind of markup? Use the correct element for the
job:

<h1>Page Title</h1>
<p>Use the form to send information.</p>
<form method="post" action="somescript">
<fieldset><legend>Form Title</legend>
<label for="field1">Field1 </label> <input type="text" name="field1"
id="field1" value="initial value"><br>
<label for="field2">Field2 </label> <input type="text" name="field2"
id="field2" value="initial value"><br>
<input type="submit" value="Submit">
</fieldset>
</form>

Using this kind of markup, you can style the elements any way you wish.
I agree. I really hate sites that use headings just to make a bit of
text bold, you should really use a style rule for such things.
 
J

Jonathan N. Little

DocuMaker said:
I can't think of a reason since forms automatically break onto a new
line. Unless forms can accept styles - then no.

Of course forms can be styled

form {
margin: .5em;
padding: 1em;
border: 5px inset #f00;
color: ##000;
background-color: #fee;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top