Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    18
    Member #
    20398

    div element for nonflow content?

    Is there a technical problem if I divide a page using div elements for my editing convenience if a div element would contain something other than flow content, at least metadata content, a script? HTML5 specifies flow content only, but it also says, in section 3.2.4, "[a]uthors must not use HTML elements anywhere except where they are explicitly allowed, as defined for each element, or as explicitly required by other specifications", which means a div element can be used for other kinds of content as long as some unidentified spec allows it, which I assume means it works if a browser will allow it. I like organizing the page so I can locate parts, the div element helps me, and I prefer divs over comments. And I use CSS on divs, so that ending one div before the script and not starting another container element until after the script means the script might lose the website look that would be from CSS, like background color or gradient. But a validator (https://validator.w3.org/nu/) recently flagged one div element that contained only a script. That div is within another div. In my browser, the script works even from within the div element, but I can't test in all browsers. I can't usually test in IE, Edge, Opera, or, lately, Chromium, for example. Are divs with nonflow content a problem? Or should the HTML5 spec just be amended to allow divs for other kinds of content?

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:43 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com