Here's the code snippet :
<body>
<div class="headerCont noprint">
<div class="headerHold">
<div class="logoCont"><img src="images/logo.jpg" width="104" height="74" alt="Logo"></div>
<ul id="navCont">
<li><a href="blogs.html">blogs</a></li>
<li><a href="products.html">products</a></li>
<li class="active"><a href="experts.php">Expert</a></li>
<li><a href="events.html">events</a></li>
<li><a href="business.html">Business</a></li>
</ul>
<div class="rightHeadCont">
<div class="smIcon fbIcon"><a href="#"></a></div>
<div class="smIcon twtIcon"><a href="#"></a></div>
<form id="search">
<input type="submit" value="Submit" class="searchBtn">
<input type="text" name="search" placeholder="search" class="searchInput">
</form>
</div>
</div>
</div>
<div class="breadCrumbs noprint">
<ul>
<li><a href="index.html">Home</a></li>
<li><a>></a></li>
<li><a>Expert</a></li>
</ul>
</div>
<div class="cl"></div>
<div class="container">
<ul class="banner noprint">
<li><img src="images/headerImg.jpg" /></li>
<li><img src="images/headerImg.jpg" /></li>
<li><img src="images/headerImg.jpg" /></li>
<li><img src="images/headerImg.jpg" /></li>
</ul>
<div class="bannerShdw noprint"><img src="images/bannerShdw.jpg" width="100%" height="13"></div>
<div class="titleCont">
<h1>Expert</h1>
<ul id="docIcons">
<li class="a"><a href="#"></a></li>
<li class="b"><a href="javascript:window.print()"></a></li>
<li class="c"><a href="#"></a></li>
<li class="d"><a href="#"></a></li>
</ul>
</div>
<?php
$expertsql = "SELECT * FROM experts WHERE is_active = '1' ";
$expertex = mysqli_query($db,$expertsql);
$ispresent = @mysqli_num_rows($expertex);
if($ispresent > 0)
{
while($experts = mysqli_fetch_assoc($expertex))
{
?>
<div class="expertCont">
<div class="imgCont">
<div class="imgHold">
<img src="<?php echo base_url;?>thumbnail.php?file=admin/uploads/experts/<?php echo $experts['image'];?>&width=170&height=169&maxw=170&maxh=169">
</div>
</div>
<h2><?php echo ucwords($experts['name']);?></h2>
<?php echo trim($experts['short_description']);?>
<div class="readMore">
<a href="expert-detail.php?id=<?php echo $experts['id'];?>">Read more ></a>
</div>
</div>
<?php
}
}
else
{
echo 'No Expert Found';
}
?>
</div>
CSS :-
@media print
{
.noprint {display:none;}
}
If you want to remove the blank space at the top while printing, you can apply this CSS :
.headerCont { width: 100%; height: 85px; background: url(../images/headerBg.jpg) repeat-x bottom center;
Also, don't forget to close your style rules properly for each element to avoid any unexpected behavior.