|
|
|
|
Thread title: <div> tag inside a <div> |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
05-14-2006, 03:19 PM
|
#1
|
Status: I love this place
Join date: Jan 2006
Location: BC, Canada
Expertise:
Software:
Posts: 583
|
<div> tag inside a <div>
I have tried this in coding a website, it looks fine but when I go to validate the XHTML at w3.org it says that these certain div tags cannot be placed where they are (which is in another div tag). Is there any other tag I can place this text in so that I can still use the same margin & padding attributes as a div tag uses? Sorry if this is a simple fix, first time coding with divs instead of tables
|
|
05-14-2006, 03:29 PM
|
#2
|
Status: unusual suspect ™
Join date: Feb 2005
Location: Lancaster, PA from London UK
Expertise:
Software:
Posts: 1,814
|
Impossible to really comment without a link or at least some code.
|
|
05-14-2006, 03:35 PM
|
#3
|
Status: I love this place
Join date: Jan 2006
Location: BC, Canada
Expertise:
Software:
Posts: 583
|
Oops, here is a link to my "attempt" at the coding: Link
This is what it says when I put it through the validator
# Error Line 26, column 101: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag .
...px; padding-bottom:12px" align="left">
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
✉
|
|
|
05-14-2006, 03:40 PM
|
#4
|
Status: I love this place
Join date: Jan 2005
Location: The Netherlands
Expertise: Frontend, vBulletin
Software: Coda, Photoshop
Posts: 607
|
You have put your divs inside <h3> and <h4> tags.
|
|
05-14-2006, 03:59 PM
|
#5
|
Status: Member
Join date: May 2006
Location:
Expertise:
Software:
Posts: 197
|
Bas is right. Nested div's are not a problem, but you cannot have them nested in certain tags.
|
|
05-14-2006, 04:07 PM
|
#6
|
Status: I love this place
Join date: Jan 2006
Location: BC, Canada
Expertise:
Software:
Posts: 583
|
Arent they already in the <h3> and <h4> tags?
|
|
05-14-2006, 04:10 PM
|
#7
|
Status: Request a custom title
Join date: Dec 2005
Location: LIC (NYC), NY
Expertise:
Software:
Posts: 1,026
|
They aren't supposed to be.
|
|
05-14-2006, 04:15 PM
|
#8
|
Status: I love this place
Join date: Jan 2006
Location: BC, Canada
Expertise:
Software:
Posts: 583
|
Haha, I read "You have to put your divs inside <h3> and <h4> tags." I'll try taking them out of the <h3><h4> tags and fool around with it a bit. Thanks.
|
|
05-14-2006, 04:23 PM
|
#9
|
Status: Non-conformist
Join date: Jul 2005
Location: Canberra, Australia.
Expertise:
Software:
Posts: 1,172
|
Also, I should probably point out that you're using <h> tags incorrectly anyway - They're designed to be used for header text only, not large slabs of paragraphs.
|
|
05-14-2006, 04:24 PM
|
#10
|
Status: Member
Join date: May 2006
Location:
Expertise:
Software:
Posts: 197
|
This is the code that is causing your problem:
HTML Code:
<h3>
<div style="padding-left:35px; padding-top:5px; padding-right:35px; padding-bottom:12px" align="left">
<p>
My name is Matt Lister and I have been raising Bantams for 6 years, and showing for 4 years. I am currently breeding and showing the following breeds: Old English Game Bantams in Black and Brown Red, Birchen Modern Game Bantams, Quail D'anvers, and Seramas. I am also constantly working with genetics of the birds and sometimes have a few oddballs around the farm. I have created a page to showcase each of the breed I work with, a page I will keep updated with the latest birds I have for sale, a page that will list all of my show wins, and hopefully a guestbook if I can keep it filtered from all of the junk that was continuously posted in my last one. Enjoy your visit!
</p>
<p>
My name is Matt Lister and I have been raising Bantams for 6 years, and showing for 4 years. I am currently breeding and showing the following breeds: Old English Game Bantams in Black and Brown Red, Birchen Modern Game Bantams, Quail D'anvers, and Seramas. I am also constantly working with genetics of the birds and sometimes have a few oddballs around the farm. I have created a page to showcase each of the breed I work with, a page I will keep updated with the latest birds I have for sale, a page that will list all of my show wins, and hopefully a guestbook if I can keep it filtered from all of the junk that was continuously posted in my last one. Enjoy your visit!
</p>
<p>
My name is Matt Lister and I have been raising Bantams for 6 years, and showing for 4 years. I am currently breeding and showing the following breeds: Old English Game Bantams in Black and Brown Red, Birchen Modern Game Bantams, Quail D'anvers, and Seramas. I am also constantly working with genetics of the birds and sometimes have a few oddballs around the farm. I have created a page to showcase each of the breed I work with, a page I will keep updated with the latest birds I have for sale, a page that will list all of my show wins, and hopefully a guestbook if I can keep it filtered from all of the junk that was continuously posted in my last one. Enjoy your visit!
</p>
<p>
My name is Matt Lister and I have been raising Bantams for 6 years, and showing for 4 years. I am currently breeding and showing the following breeds: Old English Game Bantams in Black and Brown Red, Birchen Modern Game Bantams, Quail D'anvers, and Seramas. I am also constantly working with genetics of the birds and sometimes have a few oddballs around the farm. I have created a page to showcase each of the breed I work with, a page I will keep updated with the latest birds I have for sale, a page that will list all of my show wins, and hopefully a guestbook if I can keep it filtered from all of the junk that was continuously posted in my last one. Enjoy your visit!
</p>
<p>
My name is Matt Lister and I have been raising Bantams for 6 years, and showing for 4 years. I am currently breeding and showing the following breeds: Old English Game Bantams in Black and Brown Red, Birchen Modern Game Bantams, Quail D'anvers, and Seramas. I am also constantly working with genetics of the birds and sometimes have a few oddballs around the farm. I have created a page to showcase each of the breed I work with, a page I will keep updated with the latest birds I have for sale, a page that will list all of my show wins, and hopefully a guestbook if I can keep it filtered from all of the junk that was continuously posted in my last one. Enjoy your visit!
</p>
</div>
</h3>
Your <div> is inside the <h3> and that is illegal.
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
|
|