Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 722 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

<div> tag inside a <div>

Thread title: <div> tag inside a <div>
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
05-14-2006, 03:19 PM
#1
MattL is offline MattL
Status: I love this place
Join date: Jan 2006
Location: BC, Canada
Expertise:
Software:
 
Posts: 583
iTrader: 1 / 100%
 

MattL is on a distinguished road

Send a message via MSN to MattL

  Old  <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
seen.to is offline seen.to
seen.to's Avatar
Status: unusual suspect ™
Join date: Feb 2005
Location: Lancaster, PA from London UK
Expertise:
Software:
 
Posts: 1,814
iTrader: 0 / 0%
 

seen.to is on a distinguished road

  Old

Impossible to really comment without a link or at least some code.

05-14-2006, 03:35 PM
#3
MattL is offline MattL
Status: I love this place
Join date: Jan 2006
Location: BC, Canada
Expertise:
Software:
 
Posts: 583
iTrader: 1 / 100%
 

MattL is on a distinguished road

Send a message via MSN to MattL

  Old

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
Bas is offline Bas
Status: I love this place
Join date: Jan 2005
Location: The Netherlands
Expertise: Frontend, vBulletin
Software: Coda, Photoshop
 
Posts: 607
iTrader: -1 / 0%
 

Bas is on a distinguished road

Send a message via MSN to Bas

  Old

You have put your divs inside <h3> and <h4> tags.

05-14-2006, 03:59 PM
#5
jjmac is offline jjmac
jjmac's Avatar
Status: Member
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 197
iTrader: 0 / 0%
 

jjmac is on a distinguished road

  Old

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
MattL is offline MattL
Status: I love this place
Join date: Jan 2006
Location: BC, Canada
Expertise:
Software:
 
Posts: 583
iTrader: 1 / 100%
 

MattL is on a distinguished road

Send a message via MSN to MattL

  Old

Arent they already in the <h3> and <h4> tags?

05-14-2006, 04:10 PM
#7
freedom is offline freedom
freedom's Avatar
Status: Request a custom title
Join date: Dec 2005
Location: LIC (NYC), NY
Expertise:
Software:
 
Posts: 1,026
iTrader: 0 / 0%
 

freedom is on a distinguished road

  Old

They aren't supposed to be.

05-14-2006, 04:15 PM
#8
MattL is offline MattL
Status: I love this place
Join date: Jan 2006
Location: BC, Canada
Expertise:
Software:
 
Posts: 583
iTrader: 1 / 100%
 

MattL is on a distinguished road

Send a message via MSN to MattL

  Old

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
jono1 is offline jono1
jono1's Avatar
Status: Non-conformist
Join date: Jul 2005
Location: Canberra, Australia.
Expertise:
Software:
 
Posts: 1,172
iTrader: 0 / 0%
 

jono1 is on a distinguished road

  Old

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
jjmac is offline jjmac
jjmac's Avatar
Status: Member
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 197
iTrader: 0 / 0%
 

jjmac is on a distinguished road

  Old

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.

Closed Thread  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed