0

I want to print a bootstrap page. Here is my page layout

<div class="container">
    <div class="row">
        <div class="col-sm-4">
            <img src="image/logo.png">          
        </div>
    </div>
</div>
<div class="container" id="student">
    <div class="row">
        <div class="col-sm-4">
            <h1>Student</h1>
        </div>
        <div class="col-sm-offset-2 col-sm-6" id="date">
                <form class="form-inline">
                    <div class="form-group">
                        <label for="focusedInput"> <b>Date:</b></label>
                        <input class="form-control" id="focusedInput" type="text" placeholder="DD Month Year">
                    </div>
                </form>         
        </div>
    </div>
</div>

Also I've css

@font-face {
    font-family: "myfont";
    src: url("../fonts/opensans/OpenSans-Regular 2.ttf");
}
body{
    font-family: "myfont";
    /*-webkit-print-color-adjust: exact;*/
}

img{
    width: 150px;
}
#student{
    margin-top: 50px;
}
#date{
    background: black;
    margin-top: 20px;
    color: white;
    padding: 10px;
}

Problem is: css is not loading properly. I tried searching stackoverflow but did not get any exact solution. How can I do that? Here is the fiddle https://jsfiddle.net/wc6rga7o/

Russell
  • 1,624
  • 5
  • 23
  • 43

1 Answers1

1

try

@media print {
    /* Your styles here */
    body{
           color: #111111;
    }
    #date{
           -webkit-print-color-adjust: exact!important;
    }

}

updated your fiddle https://jsfiddle.net/wc6rga7o/2/

enter image description here

Rahul
  • 4,294
  • 1
  • 10
  • 12