"One should never assume the knowledge level of the audience." A quote from Astronaut Ed White who could give a physics lecture to K-12 and grad students at the same time.
Divs are blocks of data. You could also think of them as a box. Not unlike boxes from the store, these "code boxes" can go well in some places but not in others. Your boxes fit well in the back seat, front seat or trunk of your car but you can't put them in the engine or gas tank. If you put the boxes on your car's roof, you will need that "wrapper" to hold them down.
As data boxes, they cannot be nested in a <p>, <img, or <ul> tag BUT, can go in an <li> tag. Div tags really help in manipulating the "look of a site" by better defining our workplace.
You'll note that ZC uses mainWrapper, navMainWrapper, logoWrapper, etc. That wrapper div allows us to treat every item in it with CSS code for that specific "area".
Some purists will drop the wrapper div when there are nested divs and no "bare" p, a, ul, li, img tags. They do that because most browsers will automatically add a hidden br before and after the div and they want to use the space to share their product.
If a p tag is not nested in a div, it will require a hard-coded <span> to change its size, color, justification, etc. Not fun when the color needs to be changed in several hard-coded p tags.
There is often confusion about the significance of <div id="boxWrapper"> and <div class="boxTitle">. Some will tell you an ID div can only be used once. Not quite correct. It can only be used once on THAT page. Otherwise logoWrapper showing up on every page would be a problem.
The class div is used when that div will show up more than once on the page.
If you have any doubts when inserting something like this, just google, "can I put a div in a ### tag?" Change the ### to the tag in question.
The controlling CSS can go in any stylesheet that affects the page using the div. If I use these boxes
only on EZ-Page 3, then I would put the CSS in page3.css which is the custom stylesheet for EZ-Page 3. For this project, I used stylesheet_zEZcustom.css. Number one -- so I could easily find and change the code. Number two -- because the stylesheets are loaded alphabetically. This makes sure the code is not overwritten by a later-loading stylesheet.
This concludes today's virtual learning class.
BTW -- I also use stylesheet_zcustom.css for any changes to other general site styling. Can't use it in the case of custom stylesheets like the EZ-Page 3 scenario but, it is certainly helpful in testing an upgrade to have all your changes in one location.
Bookmarks