Css filter for media print - html

How to provide filter to the photo sent for printing. I tried adding the following css.
#media print {
.photo {
img {
filter: brightness(2);
-webkit-filter: brightness(2);
}
}
}
Nothing happens. The brightness of the pictures is same. My application captures the pictures from webcam and sends the base64 image to the server. I am using webcam.js plugin to capture the image.
HTML Code
<a onclick="printpage()" class="btn btn-success" href="#">
<i class="fa fa-print"></i>Print Card
</a> </div>
</div>
</div>
</div>
</div>
</div>
<div id="idCard_print" class="idcard">
<div class="cardinner">
<div class="cardheader">
<div class="image">
<img alt="header logo" width="40px" src="/assets/40xNxcardlogo-7e613bf7d05be0b9d2fe128f14519e11437beaa0d6b40fd2c332b6800059c783.gif.pagespeed.ic.-YOaR880p3.png" data-pagespeed-url-hash="348730017" onload="!window.__cfRl||__cfRl.r(function(){pagespeed.CriticalImages.checkImageForCriticality(this);},this)" />
</div>
<div class="afu-title">
Agriculture and Forestry University
<span>Rampur, Chitwan</span>
</div>
<div class="faculty">
Faculty of Animal Sci., Vet. Sci. & Fisheries
</div>
</div>
<div class="cardtype">
<span>Student ID Card</span>
</div>
<div class="photo">
<div class="student">
<img height="73px" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCADmAMgDASIAAhEBAxEB/8QAHQAAAAYDAQAAAAAAAAAAAAAAAAIDBAUIAQYHCf/EAEMQAAEDAgUCBAIIAwYFBAMAAAECAxEABAUGEiExB0ETUWFxCCIJFBUjMoGRoVJiwRYzQnKx0XOCkuHwGCU0Q0XS8f/EABoBAAIDAQEAAAAAAAAAAAAAAAECAAMEBQb/xAAqEQACAgICAgEEAgIDAQAAAAAAAQIRAyEEMRJBUQUT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DzQoVBWBYmT3pJSiKFCo+hkEPegNzQoVCGFbUIFChVd7CCBHtWNh+dChU9gBooTBiBQoVYAMDANZ1EHmhQokYNRk1gjaaFCg9MCCk1nsKFCh7GMlW/FChQp0FH/2Q==" data-pagespeed-url-hash="3345598353" onload="!window.__cfRl||__cfRl.r(function(){pagespeed.CriticalImages.checkImageForCriticality(this);},this)" />
</div>
<div class="sign">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAyCAMAAACd646MAAACwVBMVEX/AAD/Ghr/ODj/PT3/T0//dXX/hYX/////AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/PT3/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AA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A4qAnhZZUdDBwbOZm4I2cNf9VHAPnMsNzqWEneOHS7rsZGKKuCxBpiTQfKl8QSreVCZY9f3r9YZxgxn4GkckJDIanzloilAWf4Uy8H05kzah5rAKFn/tkAcSavowtr17N0ZudwdA9NWVtGCj6OZHUqd49c8+ZuOrXrG/PpRxkAZ+n9Wd3glldR9Y9zhMI35PNoL2iDkuRrGAshaeOl7BTgyZMv7XzDTkPByDJCV+NZ6h8Dsp3irsXBL5sPnXGm4zWimDUyr3HboAKZcGcHd3ApMhxG1hAxZRDpQs3c/CefLXWzqRz54pSnpL2YF7Sm0TGkxflyjBY1jIwSFYePAop/h6LM0R07zaFKDjnzVD0MrN229wQjvw6ctpdHIEbl1pDWF6z18cLdDWDObeFLHsZ+iPBbLXL3L73oEkmH5TRmFnxAEZMS3z2NtqA6y7XhtPTQJaFrwaL31FdzMfQmAdm61xsOwb1E0MCqFBnY8cDmNAt4WpaCmu/NkMbHElLQSTP80ZfBgaHE0JAtlbn8eXw6jB2BqmWiK0sRCRyS4hjq2eCSNkXc8D1xImGzj0TXZF0ma8i0RLprdGYUTUBnKSMX9pDcky4JmoDV2cFiZbsL8KSHqaXgUjHUziSC98WEi050+Lq4h6ZV5KVlx7sJA4VXpcMzn6+uBLlUhItUencs3Vic1FuWkJGycJDm8AFOMOuUPwpv4/k1IUMyreCqTVW+C2JosAS4x3XIe2pFGX8lvCQYQm3tJJHZPHEfatLRYkvLEiyRHLWtpULZjfkR9oIklQikWSJgB15PV3yI37UkoG3xGI0uEaoJQAVaC1AVgVO3wAAAABJRU5ErkJggg==" alt="Sardha" data-pagespeed-url-hash="2948073300" onload="!window.__cfRl||__cfRl.r(function(){pagespeed.CriticalImages.checkImageForCriticality(this);},this)" />
</div>
</div>
<div class="clearfix"></div>
<div class="details">
<ul>
<li><span>Name:</span> Roshan Gyawali</li>
<li><span>Address:</span> Rupandehi, Siyari - 7</li>
<li><span>Date of Birth:</span> 2017-11-07</li>
<li><span>Level:</span> B. V. Sc. & A.H.</li>
<li><span>Year:</span> 2013-2019</li>
</ul>
</div>
<div class="barcode">
<p>90432635</p>
<img class="img-responsive" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPgAAABIAQAAAADzYAXTAAAABGdBTUEAALGP
C/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUw
AADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAAHdihOkAAAACXBIWXMAAABIAAAA
SABGyWs+AAAAQklEQVRIx2P4jx8wtFX+Y59R+SDx4fPG9hlycuwzKiQfPmNv
Y5+XkCBRx5Y4Kj8qPyo/Kj8qPyo/Kj8qP+jkCbRvABzvCT9bo5chAAAAAElF
TkSuQmCC
" data-pagespeed-url-hash="3905847029" onload="!window.__cfRl||__cfRl.r(function(){pagespeed.CriticalImages.checkImageForCriticality(this);},this)" />
</div>
<div class="expiry">Expiry: Jan 01, 2019</div>
<div class="url">www.afu.edu.np</div>
</div>
</div>
<style>#media print{aside#sidebar,header[role="banner"],footer,#comments,#respond,header{display:none}#sidebar-wrapper,.header,table,.head,.container-fluid,#topNav,#idCard,.widget,.content-wrapper{display:none}.btn{display:none}.margin-top,.panel{display:none}body{content:asset-url("card-backgroundafu.png")}*{color:#000;// #include box-shadow(none);// #include text-shadow(none);-webkit-print-color-adjust:exact!important;color-adjust:exact!important}#page-wrapper.open{padding:0;height:0;margin:0}#page-wrapper .sidebar-footer{display:none}#page-wrapper ul.sidebar{display:none}#page-wrapper #sidebar-wrapper{display:none}#idCard_print{display:block;position:relative;background-color:#fff!important;margin:0;padding:0}#idCard_print .cardinner{padding:0}#idCard_print .cardinner .cardheader{font-size:11px;text-align:center;height:84px;line-height:11px;background-color:#deefe3!important;font-family:"Helvetica",sans-serif}#idCard_print .cardinner .cardheader .afu-title span{font-size:9px;line-height:9px;display:block}#idCard_print .cardinner .cardheader .faculty{font-size:10px;text-transform:uppercase;font-family:'',sans-serif;font-weight:700;line-height:11px;margin-top:2px}#idCard_print .cardinner .cardtype{font-family:'Helvetica',sans-serif;text-align:center;color:#fff!important;background:#8dc349!important;width:100%;margin:0 auto;font-size:11px}#idCard_print .cardinner .cardtype span{border-left:2px solid #fff!important;border-right:2px solid #fff!important;border-radius:10px;padding:2px 20px;color:#000!important}#idCard_print .cardinner .photo{height:77px;position:relative;margin-top:3px}#idCard_print .cardinner .photo .student{text-align:center}#icCard_print .cardinner .photo .student img{border:2px solid #ccc;border-radius:10px;filter:brightness(2);-webkit-filter:brightness(2)}#idCard_print .cardinner .photo .sign{margin:0 auto;top:50px;position:absolute;left:61px}#idCard_print .cardinner .photo .sign img{width:50px}#idCard_print .cardinner .photo .dean{text-align:center;font-size:10px;font-family:'Ubuntu',sans-serif;margin-top:5px;font-weight:800}#idCard_print .cardinner .details ul{list-style:none;text-align:center;margin:0;padding:0;font-size:10px;font-family:'Ubuntu',sans-serif;line-height:13px}#idCard_print .cardinner .details ul li span{font-weight:800}#idCard_print .cardinner .barcode img{width:50%;margin:0 auto}#idCard_print .cardinner .barcode p{font-family:'Ubuntu',sans-serif;font-size:9px;letter-spacing:3px;text-align:center;margin:10px 0 0 0}#idCard_print .cardinner .url{font-size:11px;text-align:center;font-family:'Ubuntu',sans-serif;background:#8dc540!important;color:#000!important}#idCard_print .cardinner .expiry{font-size:9px;font-weight:600;text-align:center;font-family:'Ubuntu',sans-serif;color:red!important}#idCard_print:before{content:"";background-image:asset-url("card-backgroundafu.png")!important;background-repeat:no-repeat;background-position:center center;content:' ';display:block;position:absolute;left:0;top:0;width:100%;height:100%;z-index:1;opacity:.1}#page { size: 53.98mm 85.60mm; margin: 0mm; }}</style>
</div>

From what I can see the only problem is that you seem to be using SASS like syntax for your CSS.
#media print {
.photo {
img {
filter: brightness(2);
-webkit-filter: brightness(2);
}
}
}
If this is raw CSS then you need to clean up the syntax to match this:
#media print {
.photo img {
-webkit-filter: brightness(2);
filter: brightness(2);
}
}
Remember to always put the vendor specific styles before the generic styles. So I moved the -webkit-filter before filter
I created a local page on my machine and emulated printing and the CSS does apply with the change above.
Also consider adding a specific class to each of the images to help improve your CSS rules.
Instead of this:
#icCard_print .cardinner .photo .student img{
border:2px solid #ccc;
border-radius:10px;
filter:brightness(2);
-webkit-filter:brightness(2)
}
You could simplify it to this:
.student-img{
border:2px solid #ccc;
border-radius:10px;
filter:brightness(2);
-webkit-filter:brightness(2)
}
with the html for that image tag being this:
<img class="student-img>
And then move the height:73px into the CSS instead of in the style attribute.
Consider using a BEM styled css and you can see a good simplification/reduction in all your CSS rules.
Also, I always use !important for everything I have in the #media print block. This is the only place I allow myself to use !important but I use it on everything just to make sure I have proper specificity of the CSS.
Look here for how to emulate print mode in Chrome

Related

Hover image issue

I have a link in text on this page, https://melodylakerart.com/product/sun-on-skin-mask-duplicate-1/ which when hovered over produces a pop up image.
As you can see, the text is broken - all the text between "sensitive' and 'off" should be on one line (including the link)
How do I get rid of the weird line breaks?
CSS is:
.hover_img a {
position: relative;
}
.hover_img a span {
position: absolute;
display: none;
z-index: 99;
}
.hover_img a:hover span {
display: block;
}
.hover_img a:hover span {
display: block;
width: 350px;
}
HTML is:
Sensitive ears? Add an
<div class="hover_img">
<a href="#">adjustable silicone strap
<span>
<img src="https://melodylakerart.com/wp-content/uploads/2020/06/Hanwell-Rainbow-Mask-1.jpg" alt="image" height="100" />
</span>
</a>
<div>
to take the pressure off
The addon is doing something strange with the internal div. It wraps the content in a p tag and pushes the div outside. Best to remove it as not needed and move the class name to the a tag (except)..... Change the a to a span because then you wont have the clickable behaviour.
Change the html to:
Sensitive ears? Add an <span class="hover_img">adjustable silicone ear protector strap <span><img src="https://melodylakerart.com/wp-content/uploads/2020/06/Mask-extenders-2.jpg" alt="image" height="100"></span></span>to take the pressure off.
Modify the Css:
span.hover_img { position:relative; color:#f66f61; }
span.hover_img span { position:absolute; display:none; z-index:99; }
span.hover_img:hover span {display: block;width: 350px;}
you have some problemes with the HTML tags organisation
try to replace the the full <div class="hover_img"> with this code
<div class="hover_img">
<p>
<span>Sensitive ears? Add an </span>
<a href="#">adjustable silicone strap
<span>
<img src="https://melodylakerart.com/wp-content/uploads/2020/06/Hanwell-Rainbow-Mask-1.jpg" alt="image" height="100" />
</span>
</a>
<span>to take the pressure off</span>
</p>
<p class="form-row form-row-wide wc-pao-addon-wrap wc-pao-addon-22252-0-0">
<label><input type="checkbox" class="wc-pao-addon-field wc-pao-addon-checkbox" name="addon-22252-0[]"
data-raw-price="1.50" data-price="1.5" data-price-type="quantity_based"
value="face-mask-strap-extension-loop-ear-protector"
data-label="Face Mask Strap Extension Loop Ear Protector"> Face Mask Strap Extension Loop Ear Protector
(+<span class="woocommerce-Price-amount amount"><span
class="woocommerce-Price-currencySymbol">£</span>1.50</span>)</label>
</p>
<div class="clear"></div>
</div>

CSS - Select a next element

I don't know how to explain this very well but...
I want to select an element but it's like "far" from other one
Like this:
<div class="image-div">
<img src="forest.png" class="image forest">
</div>
<p>
I want to change the color of this text if the image there ^ is "forest", which I'll change with JS
</p>
.image.forest [some selector idk] p {
color: red;
}
.image.train [some selector idk] p {
color: blue;
}
You could re-write it like this if it works for you.
<div class="image-div forest">
<img src="forest.png" class="image">
</div>
<p>I want to change the color of this text if the image there ^ is "forest", which I'll change with JS</p>
<style>
.forest + p {
color: red;
}
.train + p {
color: blue;
}
</style>
Why dont you just add a class to the p tag right after the forest image.
<div class="image-div">
<img src="forest.png" class="image forest">
</div>
<p class="forest-paragraph"></p>
.forest-paragraph {
color: #000;
}
You'd need to go from <img> to <div> to <p>, but going from <img> to <div> presents a problem: there is no CSS selector that allows one to reference an element that is higher up in the DOM tree, i.e. no child-to-parent selector.
Instead, you can apply the .forest class to the <div>.
HTML:
<div class="image-div forest">
<img src="forest.png" class="image">
</div>
<p>
I want to change the color of this text if the image there ^ is "forest", which I'll change with JS
</p>
CSS:
.forest + p {
color: red;
}

Styles not working

I have the following code.
<html>
<head>
<style>
.fb{
position: relative;
right:-1000px;
}
.info{
position:relative;
}
</style>
</head>
<body>
<div id="info">
About Us |
Privacy Policy
<a id = "fb" href="https://www.facebook.com/xyz" target="https://www.facebook.com/xyz"> <img src="../images/facebook.png" height = 16, width = 16 /> </a>
</div>
</body>
</html>
I want to move the fb link to the right corner. I guess my styling is not working. Or am I going wrong somewhere?
You have defined a class in your stylesheet
.fb{
position: relative;
right:-1000px;
}
.info{
position:relative;
}
so while using it you should do
<div class="info">
...
</div>
<div class="fb">
...
</div>
OR if you want to use id then
#fb{
position: relative;
right:-1000px;
}
#info{
position:relative;
}
<div id="info">
...
</div>
<div id="fb">
...
</div>
first don't use spaces in attr="smth". Also you use id not class so css selector should be #fb , not .fb
Use this #fb{
float:right;
}
You are using class (.class) selectors instead of id (#id) selectors in your css
The styles are not reflecting because you are using . instead of #. . is used while dealing with class, for id use #.
Try this:
#fb{
position: fixed;
right:10px;
}
#info{
position:relative;
}
Jsfiddle
<div id="info">
About Us |
Privacy Policy
<a id ="fb" href="https://www.facebook.com/xyz" target="https://www.facebook.com/xyz">
<img src="../images/facebook.png" height = 16, width = 16 alt="FB"/> </a>
</div>
CSS
#fb
{
float:right;
}
.info
{
position:relative;
}
There were no class named fb. DEMO

HTML "clean-up" service: transformation of inline style attributes into css rules

I wonder if there is a service where I can "clean-up" html-code so that all inline style="" attributes get transformed into css rules and replaced with respective class="" attributes.
For example I'd like to get from this code (file 'test.html'):
<!-- test.html -->
<div style="width:600px;margin:auto;padding:10px 0px 10px;cursor:pointer;color:#336699;font-style:italic;font-size:18px;"
onClick="toggleText('addmessage')">
<span style="border-bottom:1px dotted #336699;">
Add message</span>
</div>
<div id="addmessage" style="width:600px; margin:auto;padding:10px 0px 10px;display:none;">
... etc.
somethig like this:
<!-- test.html -->
<div class="class_1"
onClick="toggleText('addmessage')">
<span class="class_3">
Add message</span>
</div>
<div id="addmessage" class="class_2">
... etc.
plus css file:
<!-- style.css -->
.class_1, .class_2
{
width:600px;
margin:auto;
padding:10px 0px 10px;
}
.class_1
{
cursor:pointer;
color:#336699;
font-style:italic;
font-size:18px;
}
.class_2
{
display:none;
}
class_3
{
border-bottom:1px dotted #336699;
}
http://www.tinytool.net/96002/inline_css_extractor

what is the most specific css reference for this

I am trying to override the css from another file and I would like to know how specific of a reference I would need to override it.
Here is the page I am working with if you'd like to take a look:
http://www.bolistylus.com/shop/
This is what I'm trying to override:
.products li {
float: left;
margin: 0 10px 20px 0;
padding: 0;
position: relative;
width: 150px;
}
Here is the HTML I'm working with:
<div id="main">
<section id="primary"><div id="content" role="main"><div id="breadcrumb"><a class="home" href="http://www.bolistylus.com">Home</a> › Shop</div>
<h1 class="page-title">All Products</h1>
<ul class="products">
<li class="product first">
<a href="http://www.bolistylus.com/shop/boli-2/">
<img width="150" height="150" src="http://www.bolistylus.com/wp-content/uploads/pinkproduct-150x150.png" class="attachment-shop_small wp-post-image" alt="pinkproduct" title="pinkproduct" />
<strong>Boli Pink</strong>
<span class="price">$24.00</span>
</a>
Add to cart
</li> <li class="product ">
</li></ul><div class="clear"></div>
</div></section>
</div><!-- #main -->
.products li has a specificity of (0, 0, 1, 1)
a minimal higher specificity can be created with
ul.products li which has a specificity of (0, 0, 1, 2)
See this jsfiddle: http://jsfiddle.net/DAL9A/
.products li and you can use !important if it doesnt take. Try to load that after what your trying to override.
UPDATE*
Try just using ".product"
Actually just ready your comments. What are you trying to target? The image? If So you should get the width and height out of inline and apply it in CSS