Prevent Content From Spilling Over to Next Page - html

I am building an app that formulates how much CBD needs to be put into a product to meet certain requirements. I have included instructions and required materials that are needed to make each recipe. When the user prints the recipe, ideally I would like to not show the instructions or required materials on the sheet.
I have managed to hide all of the required materials and instructions but when the page is set to be printed, it prints a blank page (I'm assuming because the content is spilling over to the next page even though it is hidden) and I do not want this to happen. Here is the HTML for the required materials and instructions:
<div class="noprint">
<hr>
<h1 id="centered">Instructions</h1><br>
<h3 id="centered">Required Materials</h3>
<div class="row">
<div class="column">
<h5 id="centered">Items</h5>
<ul>
<li>1 Aluminum Mixing Bowl</li>
<li>1 Metal Measuring Cup</li>
<li>1 Glass Measuring Cup</li>
<li>1 Small Scale</li>
</ul>
</div>
<div class="column">
<h5 id="centered">Items</h5>
<ul>
<li>1 250 mL Beaker</li>
<li>1 Funnel</li>
<li>1 Plastic Pipet</li>
<li>Cleaning Supplies & PPE</li>
</ul>
</div>
</div>
<h3 id="centered">Steps for Creation</h3>
<div class="instructions">
<ol>
<li>Always begin by washing and sanitizing hands. Then proceed to sanitize all material with rubbing alcohol
and paper towels.
</li>
<li>Measure out the correct amount of either the Dead Sea Salt, Epson Salt, or Baking Soda. Do so by using the
metal measuring cup and scooping the raw goods into the glass measuring cup. Put the raw material into the
aluminum mixing bowl.
</li>
<li>
Repeat Step 2 with both the other two materials not used in Step 1.
</li>
<li>
Measure out the correct amount of CBD tincture with the aide of the 250 mL beaker. Mix in the tincture slowly,
preferably in thirds of the total amount of tincture needed.
</li>
<li>
Use the plastic pipet to measure out the correct amount of milliliters of Grosso E.O. Mix in the Grosso E.O with
the rest of the mixture. Continue to mix until the solution is as homeogeneous as possible.
</li>
<li>
Put aluminum foil over the top of the mixing bowl, write the batch number on top, and store the finished product
in a freezer one day before bottling.
</li>
</ol>
</div>
</div>
And here is the CSS for the "noprint" class:
/* Do not print */
.noprint {
visibility: hidden;
}
Any help is greatly appreciated. Thank you!

I found the solution. Here is the code that I added to my print styles sheet.
html, body {
border: 1px solid white;
height: 99%;
page-break-after: avoid;
page-break-before: avoid;
}

Related

html positioning question, need to position sections

hi so iv been writing html for a website and was wondering if there is anyway someone could help me im trying to get my 2 sections " early history" and " european adoption" side by side above " modern cards " any recommendations? i dont know how to position them like this any help would be greatly appreciated
<!DOCTYPE html>
<html>
<head>
<title>History</title>
<link rel="stylesheet" type="text/css" href="../CSS/styles.css">
<style>
section {
margin: 10px
}
</style>
</head>
<body>
<!-- Page Header -->
<header>
<img class="imageBannerLeft" src="../images/bannerCardsLeft.png">
<img class="imageBannerRight" src="../images/bannerCardsRight.png">
<h1>Playing Cards</h1>
</header>
<!-- Navigation Bar -->
<nav>
<ul>
<li>Home</li>
<li>History</li>
<li>Multi-player</li>
<li>Single-player</li>
<li>Free Cards</li>
</ul>
</nav>
<!-- The main content of the page -->
<main>
<section>
<h2>Early history</h2>
<p>The first playing cards are recorded as being invented in China around the 9th century AD by the Tang dynasty author Su E who writes about the card game "leaf" in the text Collection of Miscellanea at Duyang. The text describes Princess Tongchang,
daughter of Emperor Yizong of Tang, playing leaf in 868AD with members of the family of the princess' husband.</p>
<p>The mass production of Cards became possible following the invention of wooden printing block technology. Early Chinese packs contained 30 cards with no suits.</p>
<p>The first cards may have doubled as actual paper currency being both the tools of gaming and the stakes being played for. This is similar to modern trading card games. Using paper money was inconvenient and risky so they were substituted by play
money known as "money cards".</p>
<p>The earliest dated instance of a game involving cards with suits and numerals occurred on 17 July 1294.</p>
</section>
<section>
<h2>European Adoption</h2>
<p>The first four-suited playing cards appeared in Europe in 1365. They are thought to originate from traditional latin decks whose suits included: cups, coins, swords, and polo-sticks. As Polo was not yet a European game, polo sticks became batons
(or cudgels). Wide use of playing cards is recorded from 1377 onwards.</p>
<p>Professional card makers in Ulm, Nuremberg, and Augsburg created printed decks. Playing cards even competed with devotional images as the most common uses for woodcuts in this period. These 15th-century playing cards were probably painted.</p>
<p>The Flemish Hunting Deck, held by the Metropolitan Museum of Art is the oldest complete set of ordinary playing cards made in Europe.</p>
<p>Cards were adapted in Europe to contain members of the royal court and by the 15th Century French and English packs of 56 cards contain the King, Queen and Knave cards.</p>
</section>
<section>
<img class="imageCardsRight" src="../images/germanPlayingCards.jpg">
<h2>Modern Cards</h2>
<p>Contemporary playing cards are grouped into three broad categories based on the suits they use: French, Latin, and Germanic. Latin suits are used in the closely related Spanish and Italian formats. The Swiss-German suits are distinct enough to merit
their subcategory. Excluding Jokers and Tarot trumps, the French 52-card deck preserves the number of cards in the original Mamluk deck, while Latin and Germanic decks average fewer.</p>
<p>Within suits, there are regional or national variations called "standard patterns" because they are in the public domain, allowing multiple card manufacturers to copy them. Pattern differences are most easily found in the face cards but the number
of cards per deck, the use of numeric indices, or even minor shape and arrangement differences of the pips can be used to distinguish them. Some patterns have been around for hundreds of years. Jokers are not part of any pattern as they are a
relatively recent invention and lack any standardized appearance so each publisher usually puts their own trademarked illustration into their decks. </p>
</section>
</main>
<!-- Page Footer -->
<footer>
<p> © Card Foundation <br> 2017 <br> Please provide feedback to: jlongridge#jlinternet.co.uk </p>
</footer>
</body>
</html>
Add a class to the first two sections and assign these rules to it:
.myClass {
display: inline-block;
width: 50%;
}
This will put them next to each other. Of course, if there are other factors that influence their width, you have to take that into account (and, for example, reduce the width accordingly)
You're looking for something along this lines, I think:
<!DOCTYPE html>
<html>
<head>
<title>History</title>
<style>
#parent {
float: left;
}
#parent section {
width: 45%;
float: left;
margin:10px
}
</style>
</head>
<body>
<!-- Page Header -->
<header>
<img class="imageBannerLeft" src="../images/bannerCardsLeft.png">
<img class="imageBannerRight" src="../images/bannerCardsRight.png">
<h1>Playing Cards</h1>
</header>
<!-- Navigation Bar -->
<nav>
<ul>
<li>Home</li>
<li>History</li>
<li>Multi-player</li>
<li>Single-player</li>
<li>Free Cards</li>
</ul>
</nav>
<!-- The main content of the page -->
<main>
<section id="parent">
<section>
<h2>Early history</h2>
<p>The first playing cards are recorded as being invented in China around the 9th century AD by the Tang dynasty author Su E who writes about the card game "leaf" in the text Collection of Miscellanea at Duyang. The text describes Princess Tongchang,
daughter of Emperor Yizong of Tang, playing leaf in 868AD with members of the family of the princess' husband.</p>
<p>The mass production of Cards became possible following the invention of wooden printing block technology. Early Chinese packs contained 30 cards with no suits.</p>
<p>The first cards may have doubled as actual paper currency being both the tools of gaming and the stakes being played for. This is similar to modern trading card games. Using paper money was inconvenient and risky so they were substituted by
play money known as "money cards".</p>
<p>The earliest dated instance of a game involving cards with suits and numerals occurred on 17 July 1294.</p>
</section>
<section>
<h2>European Adoption</h2>
<p>The first four-suited playing cards appeared in Europe in 1365. They are thought to originate from traditional latin decks whose suits included: cups, coins, swords, and polo-sticks. As Polo was not yet a European game, polo sticks became batons
(or cudgels). Wide use of playing cards is recorded from 1377 onwards.</p>
<p>Professional card makers in Ulm, Nuremberg, and Augsburg created printed decks. Playing cards even competed with devotional images as the most common uses for woodcuts in this period. These 15th-century playing cards were probably painted.</p>
<p>The Flemish Hunting Deck, held by the Metropolitan Museum of Art is the oldest complete set of ordinary playing cards made in Europe.</p>
<p>Cards were adapted in Europe to contain members of the royal court and by the 15th Century French and English packs of 56 cards contain the King, Queen and Knave cards.</p>
</section>
</section>
<section>
<img class="imageCardsRight" src="../images/germanPlayingCards.jpg">
<h2>Modern Cards</h2>
<p>Contemporary playing cards are grouped into three broad categories based on the suits they use: French, Latin, and Germanic. Latin suits are used in the closely related Spanish and Italian formats. The Swiss-German suits are distinct enough to
merit their subcategory. Excluding Jokers and Tarot trumps, the French 52-card deck preserves the number of cards in the original Mamluk deck, while Latin and Germanic decks average fewer.</p>
<p>Within suits, there are regional or national variations called "standard patterns" because they are in the public domain, allowing multiple card manufacturers to copy them. Pattern differences are most easily found in the face cards but the number
of cards per deck, the use of numeric indices, or even minor shape and arrangement differences of the pips can be used to distinguish them. Some patterns have been around for hundreds of years. Jokers are not part of any pattern as they are
a relatively recent invention and lack any standardized appearance so each publisher usually puts their own trademarked illustration into their decks. </p>
</section>
</main>
<!-- Page Footer -->
<footer>
<p> © Card Foundation <br> 2017 <br> Please provide feedback to: jlongridge#jlinternet.co.uk </p>
</footer>
</body>
</html>
I've wrapped your sections in another section (parent) and just adapted the CSS code a little bit.
I've put width:45% so you can keep your margin:10px. Otherwise I would probably have set width:50%
Try using display:flex; on parent div
main {
display: flex;
width: 100%;
}
<!DOCTYPE html>
<html>
<head>
<title>History</title>
<link rel="stylesheet" type="text/css" href="../CSS/styles.css">
</head>
<body>
<!-- Page Header -->
<header>
<img class="imageBannerLeft" src="../images/bannerCardsLeft.png">
<img class="imageBannerRight" src="../images/bannerCardsRight.png">
<h1>Playing Cards</h1>
</header>
<!-- Navigation Bar -->
<nav>
<ul>
<li>Home</li>
<li>History</li>
<li>Multi-player</li>
<li>Single-player</li>
<li>Free Cards</li>
</ul>
</nav>
<!-- The main content of the page -->
<main>
<section>
<h2>Early history</h2>
<p>The first playing cards are recorded as being invented in China around the 9th century AD by the Tang dynasty author Su E who writes about the card game "leaf" in the text Collection of Miscellanea at Duyang. The text describes Princess Tongchang,
daughter of Emperor Yizong of Tang, playing leaf in 868AD with members of the family of the princess' husband.</p>
<p>The mass production of Cards became possible following the invention of wooden printing block technology. Early Chinese packs contained 30 cards with no suits.</p>
<p>The first cards may have doubled as actual paper currency being both the tools of gaming and the stakes being played for. This is similar to modern trading card games. Using paper money was inconvenient and risky so they were substituted by play
money known as "money cards".</p>
<p>The earliest dated instance of a game involving cards with suits and numerals occurred on 17 July 1294.</p>
</section>
<section>
<h2>European Adoption</h2>
<p>The first four-suited playing cards appeared in Europe in 1365. They are thought to originate from traditional latin decks whose suits included: cups, coins, swords, and polo-sticks. As Polo was not yet a European game, polo sticks became batons
(or cudgels). Wide use of playing cards is recorded from 1377 onwards.</p>
<p>Professional card makers in Ulm, Nuremberg, and Augsburg created printed decks. Playing cards even competed with devotional images as the most common uses for woodcuts in this period. These 15th-century playing cards were probably painted.</p>
<p>The Flemish Hunting Deck, held by the Metropolitan Museum of Art is the oldest complete set of ordinary playing cards made in Europe.</p>
<p>Cards were adapted in Europe to contain members of the royal court and by the 15th Century French and English packs of 56 cards contain the King, Queen and Knave cards.</p>
</section>
</main>
<section>
<img class="imageCardsRight" src="../images/germanPlayingCards.jpg">
<h2>Modern Cards</h2>
<p>Contemporary playing cards are grouped into three broad categories based on the suits they use: French, Latin, and Germanic. Latin suits are used in the closely related Spanish and Italian formats. The Swiss-German suits are distinct enough to merit
their subcategory. Excluding Jokers and Tarot trumps, the French 52-card deck preserves the number of cards in the original Mamluk deck, while Latin and Germanic decks average fewer.</p>
<p>Within suits, there are regional or national variations called "standard patterns" because they are in the public domain, allowing multiple card manufacturers to copy them. Pattern differences are most easily found in the face cards but the number
of cards per deck, the use of numeric indices, or even minor shape and arrangement differences of the pips can be used to distinguish them. Some patterns have been around for hundreds of years. Jokers are not part of any pattern as they are a
relatively recent invention and lack any standardized appearance so each publisher usually puts their own trademarked illustration into their decks. </p>
</section>
<!-- Page Footer -->
<footer>
<p> © Card Foundation <br> 2017 <br> Please provide feedback to: jlongridge#jlinternet.co.uk </p>
</footer>
</body>
</html>
You could also try the css grid. It's very powerful in terms of building complex grid layout.
Documentation
.parentDiv {
display: grid;
}
.firstChild {
grid-column: 1;
background-color: yellow;
}
.secondChild {
grid-column: 2;
background-color: lime;
}
<div class="parentDiv">
<div class="firstChild">
Column 1
</div>
<div class="secondChild">
Column 2
</div>
</div>

Used span to style certain words in list. It shifted other element to next row. Why and how to fix?

I'm working on a basic bootstrap project.
I used a span tag to style certain words in my list. Like this:
<li>The agile feline <span class="text-info" style="font-size:30px"><strong> squeezed through</strong></span> the fence</li><br>
and in doing so, it shifted my other bullet list(on right hand side) and empty middle column down to the next row. It's supposed to go:
List ------ Empty middle column ------- List
But instead looks like this:
List
Empty middle column ------ List (<---with these ones on the next line; they should all be on same line)
Altogether, that section looks like this:
<div class="row bullet" style="margin-top:15px">
<div class="col-md-4 text-left">
<ul class="bg-success">
<li>Water is a<span class="text-info" style="font-size:30px"><strong> sacred element </strong></span> and the fundamental building block of ALL life</li><br>
<li><span class="text-info" style="font-size:30px"><strong>Water</span> in its purist form, <span class="text-info" style="font-size:30px"><strong>cleanses</span>; both externally and <span class="text-info" style="font-size:30px"><strong> spiritually</span></li><br>
<li><span class="text-info" style="font-size:30px"><strong>Preservation</span> of streams, springs and rivers <span class="text-info" style="font-size:30px"><strong>is vital</span></li><br>
<li>Approximately <span class="text-info" style="font-size:30px"><strong>400 billion gallons</span> of water are used every day in the United States</li><br>
<li>By 2025, half of the world’s population will be living in water-stressed areas.</li><br>
</ul>
</div><!--left list-->
<div class="col-md-4 text-center bg-danger"></div><!--empty mid column-->
<div class="col-md-4">
<ul class="bg-warning">
<li class="right">844 million people in the world- one in ten- do not have access to an improved source of drinking water</li><br>
<li class="right">Every minute a newborn baby dies from infection caused by a lack of clean water and an unclean environment. </li><br>
<li class="right">Collectively, South African women and children walk a daily distance equivalent to 16 trips to the moon and back to fetch water</li><br>
<li class="right">Globally, at least 2 billion people use a drinking-water source contaminated with feces</li><br>
</ul>
</div><!--right list-->
Everything was laid out as it was supposed to be until I styled certain words using the span tag. I've done searches upon searches and haven't been able to find clear information to assist me through this. And I can't find any documentation of this specific issue either. I also came across the usage of span inside of a div like: div class="span".....
Now I'm confused if it should be inside of another div or its own tag??...

CSS Show When Clicked Only Access to Stylesheet [duplicate]

This question already has an answer here:
CSS Show Hide Only
(1 answer)
Closed 8 years ago.
The design of my website is integrated within their company. Basically they are rebranding their website with my information and logo. They want extra money to change any HTML files. I only have access to the stylesheets .css files and images. I have tried the hover in css but I would like it to remain open if clicked on. OR hover and delayed before closing
Can I make a css show/hide with the h3 listed in the sample below: I would like to hide the content under each h3 until the user clicks on it. I have shortened the HTMl I pulled from the product page for sample purposes.
<div id="product_text_content">
<p>Digital Brochures come in full color on 1 or 2 sides. Available options: 8 paper stocks, 5 sizes, and 3 coatings.</p>
<h3 class="gray">SIZE:</h3>
<ol>
<li>8.5" x 11"</li>
<li>8.5" x 14"</li>
<li>11" x 17"</li>
<li>11.5" x 17.5"</li>
<li>5.5" x 8.5"</li>
</ol>
<h3 class="gray">PAPER OPTIONS:</h3>
<ol>
<li>100# Gloss Text available</li>
<li>95# Gloss Cover available</li>
<li>80# Uncoated Offset Smooth Text</li>
<li>100# Uncoated Cover available</li>
<li>70# White Linen Text</li>
<li>100# White Linen Cover</li>
</ol>
<h3 class="gray">COATING OPTIONS:</h3>
<ol>
<li>No Coating available on all stocks.</li>
</ol>
<h3 class="gray">FOLDING OPTIONS:</h3>
<ol>
<li>Tri-Fold</li>
<li>Z-Fold</li>
<li>... and more</li>
</ol>
<h3>Custom Estimate:</h3>
<p>For custom orders or quantities not listed for your desired product, please click here for a custom estimate.</p>
<h3>Explanation of Turnaround Time</h3>
<p>Here's a quick chart to explain turnaround times:</p>
<img src="/img/products/turnaround.png" height="375" width="380">
<p>Please note that turnaround time does not include shipping or mailing time. You may select from available production turnaround times and your preferred shipping time as you place your order.</p>
<p>Turnaround times begin when the proof is approved. All times are based on standard business days Monday through Friday excluding federal holidays. For orders shipping to the <font color="blue">blue zone</font>, please use the Eastern time zone (New York). For orders shipping to the <font color="red">red zone</font>, please use the Pacific time zone (California). Please see the below map:</p>
<img src="/img/products/map.jpg" height="155" width="300">
<p>Our products are the same great quality for every turnaround time we offer.</p>
To toggle data on and off (show and hide in this case), you will need to use js/jquery. This can only be called through HTML, so I'm afraid you might have to bite the bullet and pay for HTML access.

CSS Show Hide Only

The design of my website is integrated within their company. Basically they are rebranding their website with my information and logo. They want extra money to change any HTML files. I only have access to the stylesheets .css files and images.
Can I make a css show/hide with the h3 listed in the sample below:
I would like to hide the content under each h3 until the user clicks on it. I have shortened the HTMl I pulled from the product page for sample purposes.
<div id="product_text_content">
<p>Digital Brochures come in full color on 1 or 2 sides. Available options: 8 paper stocks, 5 sizes, and 3 coatings.</p>
<h3 class="gray">SIZE:</h3>
<ol>
<li>8.5" x 11"</li>
<li>8.5" x 14"</li>
<li>11" x 17"</li>
<li>11.5" x 17.5"</li>
<li>5.5" x 8.5"</li>
</ol>
<h3 class="gray">PAPER OPTIONS:</h3>
<ol>
<li>100# Gloss Text available</li>
<li>95# Gloss Cover available</li>
<li>80# Uncoated Offset Smooth Text</li>
<li>100# Uncoated Cover available</li>
<li>70# White Linen Text</li>
<li>100# White Linen Cover</li>
</ol>
<h3 class="gray">COATING OPTIONS:</h3>
<ol>
<li>No Coating available on all stocks.</li>
</ol>
<h3 class="gray">FOLDING OPTIONS:</h3>
<ol>
<li>Tri-Fold</li>
<li>Z-Fold</li>
<li>... and more</li>
</ol>
<h3>Custom Estimate:</h3>
<p>For custom orders or quantities not listed for your desired product, please click here for a custom estimate.</p>
<h3>Explanation of Turnaround Time</h3>
<p>Here's a quick chart to explain turnaround times:</p>
<img src="/img/products/turnaround.png" height="375" width="380">
<p>Please note that turnaround time does not include shipping or mailing time. You may select from available production turnaround times and your preferred shipping time as you place your order.</p>
<p>Turnaround times begin when the proof is approved. All times are based on standard business days Monday through Friday excluding federal holidays. For orders shipping to the <font color="blue">blue zone</font>, please use the Eastern time zone (New York). For orders shipping to the <font color="red">red zone</font>, please use the Pacific time zone (California). Please see the below map:</p>
<img src="/img/products/map.jpg" height="155" width="300">
<p>Our products are the same great quality for every turnaround time we offer.</p>
</div>
You can do something like this:
/* Make H3 look like a link. */
h3 {cursor: pointer;}
/* Hide all the OLs initially */
h3 + ol {display: none;}
/* Show when the user hovers H3 */
h3:hover + ol {display: block;}
/* Or show when he clicks and holds */
h3:active + ol {display: block;}

Structured Data for Reocurring Event

I'm the webmaster for smctheatre.com. We're a community theatre that puts on a handful of plays each year. I'm adding to my toolbox with learning structured data. Microformat, microdata, or RDFa, I don't have any strong preference for one over another. I do like the syntax of RDFa Lite and microfomat over microdata and full-blown RDFa.
The only thing I haven't been able to get an answer to is how to mark up an event that occurs on multiple dates, and sometimes at different times.
Here's a trimmed down snippet from the site:
<article>
<header>
<h1>Play Name</h1>
<div class="addthis_toolbox">...</div>
</header>
<aside>
<h2>Dates</h2>
<ul>
<li>May</li>
<li>Fridays 17 & 24</li>
<li>Saturdays 18 & 25</li>
<li>Sundays 19 & 26</li>
<li>Monday 27</li>
<li>All shows start at 7:30 PM</li>
</ul>
<h2>Tickets</h2>
<ul>
<li>Adult $8.00</li>
<li>Child (5-17) $5.00</li>
</ul>
<h2>Directed By</h2>
<ul>
<li>Director Name</li>
</ul>
</aside>
<div>
<p>Summary of a theatre play....</p>
</div>
</article>
Duration of plays are typically two hours, but given that these are live performances, there's no hard and fast ending time.
How do I mark up the content to indicate the dates and times?
Seriously doubt there's an example of exactly what you want, but microformats are flexible and I think I've found enough to get you started:
<div class="vevent">
<a class="url" href="http://conferences.oreillynet.com/pub/w/40/program.html">
http://conferences.oreillynet.com/pub/w/40/program.html
</a>
<span class="summary">Web 2.0 Conference</span>:
<abbr class="dtstart" title="2005-10-05">October 5</abbr>-
<abbr class="dtend" title="2005-10-07">7</abbr>,
at the <span class="location">Argent Hotel, San Francisco, CA</span>
</div>
The example below uses multiple dates at the same venue; swap out the div for your article and looks like you're in business. easily make your header the summary, and put the description class on your p for summary...even though that sounds backwards, it's what you want.
How much further you want to take it is really up to you. I see where you could work start times, possibly a url....and also more microformats, to get even more goodness out of them. You should check out the wiki, it's full of great info, and examples from which you can and should pilfer.
http://microformats.org/wiki/hcalendar