jocar6562 Posted June 22, 2016 Share Posted June 22, 2016 (edited) Hi I cannot find a way to validate this code. marked in red error The report I get back is "expected Element p not allowed as child of element h2 in this context" <div class="content-grid"> <a href="single.html" class="b-link-stripe b-animate-go"> <img src="images/pi2.jpg" alt="rose"> <div class="b-wrapper"> <h2 class="b-animate b-from-left b-delay03 "> <span>Cool App Design</span> <p>development, mobile</p> <i> </i> </h2> </div> When I rewrite to; <div class="content-grid"> <a href="single.html" class="b-link-stripe b-animate-go"> <img src="images/pi2.jpg" alt="rose"> <div class="b-wrapper"> <h2 class="b-animate b-from-left b-delay03 "> <span>Cool App Design</span> development, mobile <i> </i> </h2> </div> The above goes through validation when published but just below the 2 lines of text is a short Line you loose this effect on the 2nd script Tried all the tags tried lo li h1 h2 3h and others to try and get it validated with to include the short line below the text. But I am stuck Thank you for your time JohnC Edited June 22, 2016 by jocar6562 Link to comment Share on other sites More sharing options...
dsonesuk Posted June 22, 2016 Share Posted June 22, 2016 (edited) Like the error message says you cannot have block element paragraph within block element h2, but you can use inline element such as span. You can use <br> or a span and style it as a block element. Edited June 22, 2016 by dsonesuk Link to comment Share on other sites More sharing options...
jocar6562 Posted June 22, 2016 Author Share Posted June 22, 2016 Like the error message says you cannot have block element paragraph within block element h2, but you can use inline element such as span. You can use <br> or a span and style it as a block element. Hi Thank you The <i> and <span> worked but put the text out of place the <br> worked well. I did think about styling it in a block but <br> works fine.AS I understand the <br> is useful for writing addresses and poems and did not consider using it for other purposes. Thank you again for your time JohnC JohnC Link to comment Share on other sites More sharing options...
dsonesuk Posted June 22, 2016 Share Posted June 22, 2016 All you had to do really is make first-child span a block element .b-animate.b-from-left.b-delay03 span:first-child {display: block;} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now