开发者

control image size

开发者 https://www.devze.com 2023-01-28 08:01 出处:网络
I had re-sized the image to be suitable in my page by javascript but when I print the page , the images appear in bigger size , I tried to control the size of images in css , but they does not affecte

I had re-sized the image to be suitable in my page by javascript but when I print the page , the images appear in bigger size , I tried to control the size of images in css , but they does not affected by i开发者_如何学编程t :

    @media print {

       img {

             width: 544px;
             height: 450px;

           }

    }

any one can help ?


try changing your code to include the !important attribute.

@media print {

   img {

         width: 544px !important;
         height: 450px !important;

       }

}

and check to see if you are force-overriding it with inline CSS. the !important attributte is supposed to ignore any inline attributes but in my experience doesn't seem to work perfectly across all browsers. you can also change the sizes to be:

         width: 5.67in !important;
         height: 4.69in !important;

assuming a flat-panel monitor. you can find the converter here

0

精彩评论

暂无评论...
验证码 换一张
取 消