CSS | bleed property

The CSS bleed property is used to extend the page bleed area outside the content box. This property cropped the content all around itself and fit in the box. This property is the part of page media which is in development mode now. The CSS bleed property make more sense with the @page rule. When you want to print anything extended right to the edge of the page this property is helpful then. Few printers do not allow to print the edges of the page. Using the bleed property allows the area printable. So when the page is trimmed off eventually the content will be.

Syntax:

bleed: auto | length;

Attribute:



  • auto: Its default value is zero unless the user create a marks property and that makes the default 6pt.
  • length It holds a number that how much the content will extend out of the box.

Below example illustrate the CSS bleed property.
Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html lang="en">
  
<head>
    <title>CSS bleed property</title>
    <style type="text/css">
        /* default for all pages */
          
        @page {
            margin: 2in;
        }
        /* margin on left page */
          
        @page :left {
            margin: 1in;
            bleed: 10pt;
        }
        /* margin on right page */
          
        @page :right {
            margin: 3in;
            bleed: 10pt;
        }
        /* top margin on first page */
          
        @page :first {
            margin-top: 5in;
        }
          
        h1 {
            color: green;
        }
    </style>
</head>
  
<body>
    <center>
        <h1>GeeksforGeeks</h1>
        <h2>CSS bleed property</h2>
        <img src=
             alt="" />
    </center>
  
</body>
  
</html>

chevron_right


Output: The darker portion of the GeeksforGeeks image is the bleed area of the content.

Supported Browsers: The major browsers are not supported by CSS bleed property.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.