Problems with the styles print unbreakable elements - html

I have this file with my styles for print a pdf:
#media print {
::-webkit-scrollbar {
display: none;
}
body {
background-color: white !important;
overflow-y: hidden !important;
}
.main.container {
background-color: #ffffff !important;
> .menu {
display: none;
}
> .container {
overflow-y: visible !important;
}
> .content {
overflow: visible !important;
}
}
}
.unbreakable {
display:inline;
width: 100%;
background-color: lightgreen;
}
.unbreakable:after {
content: '';
display:block;
height:0;
visibility: hidden;
}
.board-print {
background-color: #FFFFFF !important;
padding: 15px;
overflow: visible !important;
font-family: #font-family;
.board-header {
font-weight: normal;
}
.board-body {
height: auto !important;
background-color: #FFFFFF;
width: 100%;
.table-wrapper {
background-color: lightcyan;
width: 100%;
}
.widget-print {
height: auto !important;
margin-bottom: 30px !important;
}
.widget-header {
font-family: #font-family;
margin-bottom: 5px;
font-weight: 300;
font-size: 1.28rem;
color: #4D4D4D;
}
.reactive-table {
page-break-after: auto !important;
overflow: visible !important;
height: auto !important;
table {
th, td{
font-weight: normal;
font-family: #font-family;
}
.table-up-icon, .table-down-icon, .filter.padded.icon {
display: none;
}
}
}
.note-widget .mce-container{
border: none !important;
}
.ruler {
display: none;
}
.chart {
width: 95%;
height: 450px;
}
}
}
the .unbreakable I use it for print only charts and works fine but when I added .table-wrapper for print tables all is broken.
this is my jade:
template(name="widgetsShowPrint")
.widget-print
+if isConfigured
+if isChart
.unbreakable
h3.widget-header #{title}
+UI.dynamic template=type data=widgetData
+else
table.table-wrapper
tbody
tr
td
h3.widget-header #{title}
+UI.dynamic template=type data=widgetData
there I have a conditional for uses .unbreakable or the table wrapper.
I tried to print a PDF the size of the page is A4 but it doesn't work. Someone could help me, I am not expert in CSS.
I attached a image with the result.

This should work :
#media print {
.unbreakable {
page-break-inside: avoid;
}
}
Check the browser compatibility

the solution was:
template(name="widgetsShowPrint")
.widget-print
+if isConfigured
table.table-wrapper
tbody: tr: td(class="{{type}}-container")
h3.widget-header #{title}
+UI.dynamic template=type data=widgetData
I added a type td(class="{{type}}-container")
and in less file I added the size for any td:
.board-body {
height: auto !important;
background-color: #FFFFFF;
width: 100%;
.table-wrapper {
width: 100%;
td.chart-container {
height: #mid-page-size;
}
}
and I solve my problem.

Related

How to make the iframe scrollable to show all content?

I'm trying to finish off our rehoming page, where a visitor clicks on an animal to open an iframe with more info output from our database. But I can't get the iframe scrollable. I've searched online extensively but can't get any of the suggestions to work.
What am I doing wrong? (I'm way out of my league with code but just doing the best I can with what I find online, so I may have made some basic errors.) Any help at all is greatly appreciated.
HTML:
<!DOCTYPE html>
<html lang="en">
<title>iFrame</title>
<script>
asm3_adoptable_filters = "size agegroup sex breed species";
asm3_adoptable_extra = function(a) {
return '<span class="waitingtime">Time waiting for a home: ' + a.TIMEONSHELTER + '</span>';
}
asm3_adoptable_iframe = true;
asm3_adoptable_iframe_fixed = true;
asm3_adoptable_translations = {
"(any sex)": "Any sex",
"(any size)": "Any size",
"(any breed)": "Any breed",
"(any age)": "Any age",
"(any species)": "Any species"
}
asm3_adoptable_sort = "-#DAYSONSHELTER";
</script>
<style>
.waitingtime {
color: black;
font-family: filson soft regular,sans-serif;
</style>
<div id="asm3-adoptables"></div>
<script src="https://service.sheltermanager.com/asmservice?method=animal_view_adoptable_js&account=sm1510"
></script>
Page CSS:
#asm3-adoptable-iframe-overlay{
background-color: rgba(0 0 0 / 57%) !important;
}
#asm3-adoptable-iframe{
overflow-y: scroll !important;
width: 479px !important;
max-width: 100%;
margin: 0 auto;
display: block;
height: 90vh !important;
background-color:white;
margin-top:3em;
}
#asm3-adoptable-iframe-close{
background-color: #c92327;
color: white;
padding: 7px 23px;
/* margin-top: 39px !important; */
position: absolute;
border-radius: 5px;
text-align: center;
right: 0;
left: 0;
margin-top: 34px;
width: 200px;
margin: 0 auto;
top:44px;
}
Element CSS:
.asm3-adoptable-item {
display: inline-block;
text-align: center;
background-color: white;
margin-bottom: 12px;
padding-top: 25px;
width: 31.8%;
margin: 10px;
}
.asm3-adoptable-item:hover {
background-color: black;
}
.asm3-adoptable-item:hover .asm3-adoptable-tagline {
color: white;
}
.asm3-adoptable-name {
font-family: "proxima soft extrabold", sans-serif;
font-size: 44px;
color: #c92327;
margin-top: -16px;
display: block;
}
.asm3-adoptable-tagline {
text-transform: lowercase;
font-family: "proxima soft extrabold",sans-serif;
font-size: 18px;
color: black;
margin-top: -10px;
display: block;
}
.asm3-adoptable-item:hover .asm3-adoptable-name {
color: #c92327;
}
.asm3-adoptable-item:hover .waitingtime {
color: white;
}
.asm3-adoptable-thumbnail {
margin-top: 15px;
width: 425px;
max-width: 100%;
height: 425px;
}
.asm3-adoptable-reserved {
position: relative;
color: white;
display: inline-block;
padding: 5px;
overflow: hidden;
font-family: "proxima soft extrabold", sans-serif;
font-size: 18pt;
}
.asm3-adoptable-reserved span:before {
content: "RESERVED";
}
.asm3-adoptable-reserved span {
position: absolute;
display: inline-block;
right: -60px;
text-align: center;
top: 50px;
background: #c92327;
width: 275px;
transform: rotate(45deg);
}
#asm3-adoptable-filters {
overflow:hidden;
}
#asm3-adoptable-filters select {
width: 17%;
float: left;
margin: 20px;
}
#asm3-adoptable-filters {
font-family: "proxima soft extrabold", sans-serif;
font-size: 22px;
background-color: #dab348;
}
.asm3-adoptable-list {
display: flex;
flex-wrap: wrap;
}
#media only screen and (max-width: 992px) {
.asm3-adoptable-item {
width:50%;
}
}
#media only screen and (max-width: 768px) {
.asm3-adoptable-item {
width:100%;
}
}
You are missing a closing bracket "}" in your <style> tags. After playing around with your website a little I believe you are talking about some sort of full screen modal. But then it seems you are using a iframe in the modal. You might consider not using an iframe because there is really no need and it may solve your problems. Another thing I noticed is that you don't have any links between your html and your css which you might want to look into.

Ant Design Tab unwarranted button

I have the following antd Tabs. How to get rid of the ... button on the right? (Note that it disappears when the screen width is decreased.)
The structure is like this:
<Tabs type="card">
<TabPane tab="A">
.....
</TabPane>
<TabPane tab="B">
.....
</TabPane>
</Tabs>
This is the style:
.ant-tabs-tab {
flex-grow: 1;
margin-right: 0px;
width: 100%;
height: 50px;
text-align: center;
font-weight: bold;
font-size: 15px;
justify-content: center;
color: #94a3ac;
}
.ant-tabs-nav-list {
width: 100%;
border-bottom: 6px solid #093150;
}
.ant-tabs-top > .ant-tabs-nav {
margin-bottom: 0;
}
.ant-tabs-card > .ant-tabs-nav .ant-tabs-tab {
border: none;
background-color: rgba(255, 255, 255, 0.68);
}
.ant-tabs-tab-active {
background-color: #093150 !important;
.ant-tabs-tab-btn {
color: white !important;
}
just add this code in your css :
ant-tabs-nav-more { display: none; }
You can inspect element like this
then add code in your css:
.ant-tabs-nav-operations {
display: none !important;
}

Firefox prints less pages than chrome - why?

when I visit this page on Chrome:
https://www.rubyrange.com/shop/adventure-tours/adventure-van-tours/from-the-rockies-to-alaska-go-wild-calgary-whitehorse/
I can print 6 pages. When I visit this page on Firefox I can print 3 pages and it seems that pages 3,4,5 are missing.
Anybody has an idea what is wrong in the print css here?
/* Print Style Sheet */
#media print {
* {
-webkit-print-color-adjust: exact !important; /* Chrome, Safari */
color-adjust: exact !important; /*Firefox*/
}
#page {
/*size: auto;
margin: 0;*/
}
body {
/*margin: 10mm;*/
}
.site-inner {
position: relative;
top: 0;
}
.header-image .wrap > a {
top: 0;
}
.related.products,
.top-bar,
.header-bar-wrapper,
.nav-primary,
.ruby-booking-wrapper,
.envira-gallery-position-overlay,
.tours-legend,
.tours-media-headline--gallery,
.envira-gallery-wrap {
display: none;
}
a[href]:after {
display: none;
visibility: hidden;
}
.product .entry-summary {
display:flex;
flex-direction: column-reverse;
font-size: 1.3rem;
}
.tours-summary-wrapper {
width: 100%;
float: none;
}
.tours-teaser-wrapper {
width: 100%;
float: none;
padding-left: 0;
}
.tours-media-wrapper {
display: none;
}
.woocommerce-Tabs-panel {
display: block !important;
}
.tours-available-dates {
width: 100%;
}
.single-product .ruby-print-box {
display: none;
}
}

Media Queries not working even with <meta> tag

I have a simple website that I am making for my music over at (secure tunnel) http://79a6b00f.ngrok.io using media queries and everything, with the meta tag (<meta name="viewport" content="width=device-width, initial-scale=1">)in the header on index.html.
I have had someone test it on their phone, and the website zooms out, instead of maintaining scale and showing a hamburger menu. Here's my query code:
#media all and (max-width: 2600px) {
.w-ctrl {
width: 950px;
margin: auto;
}
}
#media all and (max-width: 966px) {
.w-ctrl {
width: 100%;
margin: auto;
}
.sub-header {
width: 100%;
background: #37474F;
height: 500px
}
.lnd-con .pic {
height: 500px;
background-attachment: scroll;
}
.lnd-con .label-con {
top: -350px;
text-align: center;
}
.label-con .title {
font-size: 25px;
}
.label-con .subtitle {
font-size: 25px;
}
}
#media all and (max-width: 636px) {
.w-ctrl {
width: 100%;
margin: auto;
}
.nav-con-big {
display: none;
}
.nav-con-small {
display: block;
}
.lnd-con .pic {
height: 300px;
}
.title-con {
display: none;
}
.lnd-con {
margin-top: 0px;
}
.lnd-con .label-con {
position: static;
text-align: left;
background: transparent;
padding-top: 5px;
padding-bottom: 8px;
letter-spacing: 0px;
}
.label-con .title {
font-size: 20px;
}
.label-con .subtitle {
font-size: 18px;
}
.sub-header {
width: 100%;
height: 400px
}
}
I could not fit my website into a js-fiddle, so I created a tunnel instead. I hope it's okay, as far as I am aware I'm not breaking any rules.
I see this declaration at the top of your global.css:
#viewport {
zoom: 1.0;
width: extend-to-zoom;
}
take it out or set width: device-width;:
#viewport {
width: device-width;
}
also, support for css device adaptation is pretty poor (http://caniuse.com/#search=%40viewport), possibly it is somehow conflicting with the meta tag implementation
You have to show us what meta viewport tag your using for #1. There are many.
But also; if you'd like to see the changes within your browser you can always write the media queries as between 2 widths as below:
/* SAMPLE No greater than 900px, no less than 400px */
#media (max-width:900px) and (min-width:400px) {
.CurrentlyOnVacation {
display:none;
}
}​

Print content of div using print style sheet

I need to print content of a div using print style sheet.My div has big ordered list (200+ lines).
Issue :
only print the content of div which is fitted with first page.rest of the content is not showing in print.
#media print
{
body *
{
visibility: hidden;
}
#printcontent, #printcontent *
{
visibility: visible;
}
#printcontent
{
background-color: white;
border: 0px;
position: fixed;
top: 0px !important;
left: 0px !important;
margin: 0;
font-size: 14px;
line-height: 18px;
display: inline;
overflow: visible !important;
}
*
{
overflow: visible !important;
}
#nonPrintableTable
{
display: none;
}
#nonPrintableTable div
{
display: none;
}
}
Note:
I changed doc type in order to fix positioning issue on IE.
Thank in advance.