Hello this is my first post here :)

I have designed my site layout completely from Divs and CSS style it.

I have scince realised that I should'nt have used just divs so I am trying to reduce the amount of divs on the page and use other html tags where possible but keep the original div apperance.

I have a few questions to ask -

  • Can I place a <h1>, <h2> etc inside a Div?
  • I understand I cannont place a <p> inside a <h1> or <h2>, is this correct?
  • I understand I cannot put a <ul> inside a <h1> or <h2>, is this correct?
  • I had a navigation div which housed an SSI CSS tab menu floated to the left, and a three item vertical list (ul li) floated to the right of the navigation div. I want to know if I can remove the navigation div and just use another <ul><li> as the navigation area? I cant put the SSI or vertical list in say a <h1>.
  • Finally, I can't place a Div, <ul>, <li> or <h1>etc inside a <p>, is this correct?

http://www.tomkilbourn.com/newsite/test/test.shtml

Tom

Can I place a <h1>, <h2> etc inside a Div?

answer: yes

I understand I cannont place a <p> inside a <h1> or <h2>, is this correct?

answer: correct. it is not valid html4.01

I understand I cannot put a <ul> inside a <h1> or <h2>, is this correct?

answer:correct ^ as above

I had a navigation div which housed an SSI CSS tab menu floated to the left, and a three item vertical list (ul li) floated to the right of the navigation div. I want to know if I can remove the navigation div and just use another <ul><li> as the navigation area? I cant put the SSI or vertical list in say a <h1>

answer: you should be able to use ul to suit your needs.

Finally, I can't place a Div, <ul>, <li> or <h1>etc inside a <p>, is this correct?

answer: correct not valid html

divs are not that bad interms of coding practice. it simply depends whether they are positioned absolutely. as this is a bad coding practice

Thankyofor your reply!

Tom :)

no trouble

The key fact is that you can't put a box object inside an inline object.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.