html - How to properly place a <div> element in an <a> element -


i know common problem cannot solve it. in table cell have code:

<a href="#1" class="nolink">     <div class="a1"></div>     <p class="a4">         <span class="big">1.</span>         first thing     </p> </a> 

according error:

one possible cause message have attempted put block-level element (such "<p>" or "<table>") inside inline element (such "<a>", "<span>", or "<font>").

i understand error , know cannot place neither <div> nor <p> inside <a>. tried set display:block on <a> element, didn't work. how can solve this?

solution: declare doctype html5

<!doctype html>

a lot of things has been added, changed, tweaked , removed in html5 compared html4. can see list of differences @ w3c. change after among changes introduced content-model.

the element has transparent content model (except not allow interactive content descendants), meaning has same content model parent. means element can contain e.g. div elements, if parent allows flow content.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -