I am making a invoice generate web application. invoice is design with div, and row & cell are also border lined div.
All is good in the screen but when i send invoice to print, all the bottom border line are stack up in first page which are to be in second page, weird part is this only happens in second page only.
How can I fix this??
Here is HTML code for each row this keep looping for max number of rows needed.
<div class="container_24">
<div id="invoice_frame" class="grid_18" style="padding:0px;">
<?php for ($x = 1; $x <= 60; $x++) {
<!-- Row Box <?php echo $x ?> -->
<div class="rowBox rowBox-<?php echo $x ?> ti_box_WO_bottom" data-id="1" style="width:705px;">
<div class="ti_box_onlyRight"> </div>
<div class="ti_box_onlyRight"> </div>
<div class="ti_box_onlyRight" style="width:378px;" align="left"> </div>
<div class="ti_box_onlyRight"> </div>
<div style="margin:0px; margin-right:3px;"> </div>
</div>
<?php } ?>
<div class="ti_line"> </div>
<div>
<div style="width:592px;" align="right"><strong>Total: </strong></div>
<div class="ti_box" style="width:113px;" align="center"><?php echo $TInvoice_ROW['total_amount']; ?></div>
</div>
<div>
<div style="width:592px;" align="right"><strong>Tax(GST) 6%: </strong></div>
<div class="ti_box" style="width:113px;" align="center"><?php echo $TInvoice_ROW['gst_amount']; ?></div>
</div>
<div>
<div style="width:592px;" align="right"><strong>Grand Total: </strong></div>
<div class="ti_box pv_total_box" style="width:113px; margin:0px;"><?php echo $TInvoice_ROW['total_grand']; ?></div>
</div>
<div>
<div style="padding-top:6px;" align="right"><strong>Amount in words: </strong></div>
<div style="width:559px; vertical-align:text-bottom; margin:0px;" align="left">
<textarea name="inwords" disabled="disabled" readonly class="pv_textbox_WO_outline" id="inwords" style="width:580px;"></textarea>
</div>
</div>
</div>
</div>
Here is CSS
.container_24 {
margin-left: auto;
margin-right: auto;
width: 960px;
}
#invoice_frame {
margin: 5px;
background-color: #FFF;
padding: 20px;
}
#invoice_frame div{
display: inline-block;
float: left;
}
#invoice_frame div.ti_box_onlyRight {
border-right-width: 1px;
border-right-style: solid;
border-right-color: #000;
margin:0px !important;
}
#invoice_frame div.ti_box_WO_bottom {
border: 1px solid #000;
border-bottom: none !important;
}
Related
i have created an html section in bootstrap, which contains a container and two main rows, the code is like below:
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<style>
.addonscard {
width: 100%;
height: 181px;
padding: 2%;
border: 1px solid #efefef;
}
.addonsimage {
width: 100%;
}
.add-on-add-unit {
color: #30ac15;
border: 1px solid #30ac15;
}
.add-on-add-unit {
font-size: 14px;
line-height: 20px;
padding: 2px 12px 2px 10px;
border-radius: 10px;
display: inline-block;
}
.add-on-add-unit {
color: #30ac15;
border: 1px solid #30ac15;
}
.addonsdesc {
font-size: 13px
}
#showmore {
text-align: center;
}
.clearme {
clear: both;
margin-top: 2%;
}
</style>
<section class="addons">
<div class="container">
<div class="row">
<div class="col-md-5">
<div class="addonscard">
<div class="row">
<div class="col-md-4">
<img class="addonsimage" src="test1.jpg" />
</div>
<div class="col-md-8">
<h4>This is Heading</h4>
<p>Price</p>
+ Add
</div>
</div>
<div class="row">
<div class="col-md-12">
<p class="addonsdesc">Standard photography at best value to turn make lifetime memories from your party. Photographer will be available for maximum 3 hours. 150 - 200 soft copies will be delivered through CD within 10 working days. </p>
</div>
</div>
</div>
</div>
<div class="col-md-5">
<div class="addonscard">
<div class="row">
<div class="col-md-4">
<img class="addonsimage" src="test2.jpg" />
</div>
<div class="col-md-8">
<h4>This is Heading</h4>
<p>Price</p>
+ Add
</div>
</div>
<div class="row">
<div class="col-md-12">
<p class="addonsdesc">Standard photography at best value to turn make lifetime memories from your party. Photographer will be available for maximum 3 hours. 150 - 200 soft copies will be delivered through CD within 10 working days. </p>
</div>
</div>
</div>
</div>
</div>
<div class="clearme"></div>
<div class="row">
<div class="col-md-10" id="showmore">
+ Show more add-ons
</div>
</div>
</div>
now the problem is
<div class="row">
<div class="col-md-10" id="showmore">
+ Show more add-ons
</div>
</div>
this row is going above the first row in mobile view, i have tried using mobile query to adjust but still its not moving down, can anyone please tell me what could be wrong here, thanks in advance
Remove height (181px) from ".addonscard" class in CSS and try :
.addonscard {
width: 100%;
height: auto; // height is updated from 181px to auto..
padding: 2%;
border: 1px solid #efefef;}
set height for rows and set float right for them!
#media only screen and (max-width: 576px) {
.row{
height:fit-content;
float:right;
}
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<style>
.addonscard {
width: 100%;
height: 181px;
padding: 2%;
border: 1px solid #efefef;
}
.addonsimage {
width: 100%;
}
.add-on-add-unit {
color: #30ac15;
border: 1px solid #30ac15;
}
.add-on-add-unit {
font-size: 14px;
line-height: 20px;
padding: 2px 12px 2px 10px;
border-radius: 10px;
display: inline-block;
}
.add-on-add-unit {
color: #30ac15;
border: 1px solid #30ac15;
}
.addonsdesc {
font-size: 13px
}
#showmore {
text-align: center;
}
.clearme {
clear: both;
margin-top: 2%;
}
</style>
<section class="addons">
<div class="container">
<div class="row">
<div class="col-md-5">
<div class="addonscard">
<div class="row">
<div class="col-md-4">
<img class="addonsimage" src="test1.jpg" />
</div>
<div class="col-md-8">
<h4>This is Heading</h4>
<p>Price</p>
+ Add
</div>
</div>
<div class="row">
<div class="col-md-12">
<p class="addonsdesc">Standard photography at best value to turn make lifetime memories from your party. Photographer will be available for maximum 3 hours. 150 - 200 soft copies will be delivered through CD within 10 working days. </p>
</div>
</div>
</div>
</div>
<div class="col-md-5">
<div class="addonscard">
<div class="row">
<div class="col-md-4">
<img class="addonsimage" src="test2.jpg" />
</div>
<div class="col-md-8">
<h4>This is Heading</h4>
<p>Price</p>
+ Add
</div>
</div>
<div class="row">
<div class="col-md-12">
<p class="addonsdesc">Standard photography at best value to turn make lifetime memories from your party. Photographer will be available for maximum 3 hours. 150 - 200 soft copies will be delivered through CD within 10 working days. </p>
</div>
</div>
</div>
</div>
</div>
<div class="clearme"></div>
<div class="row">
<div class="col-md-10" id="showmore">
+ Show more add-ons
</div>
</div>
</div>
Screenshots:
Inspect element shows:
The "7 in stock" i want to align with the "10" bellow
I would like to align two $elements to display on the same line.
<span class="max">
<?php echo $tickets_sold, $max_tickets; ?>
</span>
When the $tickets_sold is not included, the $max_tickets goes on the top. But when it's included, it immediately goes on the next line.
I've tried many different options as &&, and, but they never appear on the same line. I am sure the solution is easy, but I am a beginner.
$max_tickets = $product->get_max_tickets();
$tickets_sold = wc_get_stock_html( $product );
PHP code
<div class="wcl-progress-meter <?php if($product->is_max_tickets_met()) echo 'full' ?>">
<progress max="<?php echo $max_tickets ?>" value="<?php echo $lottery_participants_count ?>" low="<?php echo $min_tickets ?>"></progress></br>
<span class="zero">0 </span>
<span class="max"> <?php echo $tickets_sold, $max_tickets?></div></span>
</div>
CSS file
.wcl-progress-meter meter::-webkit-meter-suboptimum-value {
box-shadow: 0 5px 5px -5px #999 inset;
background: #cb132b;
display:inline-block;
}
.wcl-progress-meter .zero {
display: inline-block;
position: absolute;
top: -100%;
}
.wcl-progress-meter .min {
display: inline-block;
position: absolute;
top: -100%;
}
.wcl-progress-meter .max {
display: inline-block;
position: absolute;
top: -100%;
right: 0;
vertical-align: middle;
}
Just tweak your HTML a bit and all should work as you desire:
<style>
.flex-parent{display:flex;}
.flex-child{flex-basis:content;margin-right:10px;}
</style>
<div class="max flex-parent">
<div class="flex-child"><?php echo $tickets_sold;?></div>
<div class="flex-child"><?php echo $max_tickets;?></div>
</div>
<style>
.flex-parent{display:flex;}
.flex-child{flex-basis:content;margin-right:10px;}
</style>
<div class="max flex-parent">
<div class="flex-child">tickets_sold</div>
<div class="flex-child">max_tickets</div>
</div>
Or, you could also just use display:inline:
<style>
.inline-block{display:inline-block;margin-right:10px;}
</style>
<div class="max">
<div class="inline-block"><?php echo $tickets_sold;?></div>
<div class="inline-block"><?php echo $max_tickets;?></div>
</div>
<style>
.inline-block{display:inline-block;margin-right:10px;}
</style>
<div class="max">
<div class="inline-block">tickets_sold</div>
<div class="inline-block">max_tickets</div>
</div>
Update:
Note the change to the first example code - I neglected to add the flex-parent class (a className I invented, not a convention) to the .max div.
To center the items in the parent, add justify-content:center; to the parent:
<style>
.flex-parent{display:flex;}
.flex-child{flex-basis:content;margin-right:10px;justify-content:center;}
</style>
<div class="max flex-parent">
<div class="flex-child"><?php echo $tickets_sold;?></div>
<div class="flex-child"><?php echo $max_tickets;?></div>
</div>
Using the display:inline-block method:
<style>
.inline-parent{text-align:center;}
.inline-block{display:inline-block;margin-right:10px;}
</style>
<div class="max inline-parent">
<div class="inline-block"><?php echo $tickets_sold;?></div>
<div class="inline-block"><?php echo $max_tickets;?></div>
</div>
<style>
.inline-parent{text-align:center;}
.inline-block{display:inline-block;margin-right:10px;}
</style>
<div class="max inline-parent">
<div class="inline-block">tickets_sold</div>
<div class="inline-block">max_tickets</div>
</div>
my 'about me' and echoed 'about text' appear below the containing div(class="u-about"), for both of them, i have no idea why its doing this, and id rather not use relative positioning to move it up, as it seems messy, and it shouldn't be doing this in the first place. any idea's on how to fix this would be much appreciated!
my css code:
.profile-about { /* contains profile card and about card */
float: left;
}
.u-about {
position: relative;
top: 100px;
display: block;
width: 400px;
height: 220px;
background-color: white;
border-radius: 10px;
text-align: center;
margin: 0px;
}
.ubout {
margin: 0px;
}
my html code:
<section>
<div>
<div class="profile-about">
<div class="u-profile-card">
<h3>Guide:</h3>
<div>
<h2><?php echo ucfirst($first);?> <?php echo $last; ?></h2>
</div>
<div class="img-txt">
<div class="image-cropper">
<img class="u-image" src="uploads/<?php echo $image; ?>" alt="no
image found">
</div>
<div class="u-info">
<h2><?php echo ucfirst($u_city); ?>, <?php echo ucfirst($u_region); ?
>, <?php echo ucfirst($u_country); ?></h2>
<h2><?php echo ucfirst($u_rating); ?> Stars</h2>
<h2 class="u-email"><?php echo ucfirst($email); ?></h2>
</div>
</div>
</div>
<div class="u-about">
<div>
<h1>About me</h1>
<p class="ubout"><?php echo ucfirst($about); ?></p>
</div>
</div>
</div>
By the containing div, I assume you mean their direct parent <div class="u-about">. The elements do not actually appear below that... though they may well appear to, due to the fact that you have top: 100px on this element. Simply removing this will bring the entire .u-about element up the page, including both texts:
.profile-about {
/* contains profile card and about card */
float: left;
}
.u-about {
position: relative;
/*top: 100px;*/
display: block;
width: 400px;
height: 220px;
background-color: white;
border-radius: 10px;
text-align: center;
margin: 0px;
}
.ubout {
margin: 0px;
position: relative;
bottom: 200px;
}
<section>
<div>
<div class="profile-about">
<div class="u-profile-card">
<h3>Guide:</h3>
<div>
<h2>
<?php echo ucfirst($first);?>
<?php echo $last; ?>
</h2>
</div>
<div class="img-txt">
<div class="image-cropper">
<img class="u-image" src="uploads/<?php echo $image; ?>" alt="no
image found">
</div>
<div class="u-info">
<h2>
<?php echo ucfirst($u_city); ?>,
<?php echo ucfirst($u_region); ?
>, <?php echo ucfirst($u_country); ?>
</h2>
<h2>
<?php echo ucfirst($u_rating); ?> Stars</h2>
<h2 class="u-email">
<?php echo ucfirst($email); ?>
</h2>
</div>
</div>
</div>
<div class="u-about">
<div>
<h1>About me</h1>
<p class="ubout">
<?php echo ucfirst($about); ?>
</p>
</div>
</div>
</div>
</div>
</section>
Try this:-
.profile-about { /* contains profile card and about card */
float: left;
}
.u-about {
position: relative;
display: block;
top:100px;
width: 400px;
height: 220px;
background-color: white;
border-radius: 10px;
text-align: center;
margin: 0px;
}
.ubout {
margin: 0px;
position: relative;
bottom: 200px;
}
.child{
position: absolute;
height: 320pxpx;
margin: -100px 0 0 0px;
}
<section>
<div>
<div class="profile-about">
<div class="u-profile-card">
<h3>Guide:</h3>
<div>
<h2><?php echo ucfirst($first);?> <?php echo $last; ?></h2>
</div>
<div class="img-txt">
<div class="image-cropper">
<img class="u-image" src="uploads/<?php echo $image; ?>" alt="no
image found">
</div>
<div class="u-info">
<h2><?php echo ucfirst($u_city); ?>, <?php echo ucfirst($u_region); ?
>, <?php echo ucfirst($u_country); ?></h2>
<h2><?php echo ucfirst($u_rating); ?> Stars</h2>
<h2 class="u-email"><?php echo ucfirst($email); ?></h2>
</div>
</div>
</div>
<div class="u-about" style="background-color:red;">
<div class="child">
<h1>About me</h1>
<p class="ubout"><?php echo ucfirst($about); ?></p>
</div>
</div>
</div>
I Currently am designing a login page in mvc and I want to seperate certain elements so they can be styled correctly. However when I create div's inside other divs they do not stick to the outer div's height and therefore move all around the page. I will give you a sample with my code.
In my Layout.cshtml page I've got
<div class="login-box-outer">
<div class="container">
<div class="login-box">
<div class="login-logo">
<a href="example" </b> Example</a>
</div>
#RenderBody()
</div>
</div>
</div>
In my register page I have the following
.form-control{
height: 35px;
}
.login-logo{
display: none;
}
.login-box, .register-box {
width: 500px;
margin: 2% auto;
}
.text-danger {
color: #a94442;
}
.login-page, .register-page {
background: url('https://example.jpg');
background-position: center;
background-size: cover;
}
##media(max-width: 400px)
{
.login-box, .register-box {
width: 300px;
margin: 4% auto;
}
}
.intl-tel-input{
display: block !important;
}
.join-section__shadow {
left:10%;
bottom:35%;
position: absolute;
padding: 96px 0 48px;
}
.join-content-layout {
background-color: transparent;
padding: 0;
max-width: 1110px;
margin: 0 auto;
position: relative;
color:white;
}
.join-xlarge {
font-size: 38px;
line-height: 44px;
font-weight: 800;
text-shadow: 0 0 3px rgba(0,0,0,.3);
}
.join-medium {
font-size: 24px;
margin-top: 10px;
font-weight: 500;
text-shadow: 0 0 1px rgba(0,0,0,.5);
}
.content-frame.purple2-bg {
background: #fff;
}
.container-fluid.support-block {
padding-top: 30px;
padding-bottom: 30px;
}
.support-block a {
text-decoration: none;
}
</style>
still in the register page here is my html
<div class="container-fluid support-block">
<div class="join-section__shadow">
<div class="join-content-layout">
<div class="col-md-12 col-sm-12">
<h1 class="join-xlarge join-headline join-h1">
Example
</h1>
<h3 class="join-medium join-h3">
Example
</h3>
</div>
</div>
</div>
<div class="col-xs-10 col-xs-push-10 noPadding" style="bottom:100px;">
<form asp-controller="Account" asp-action="Register" asp-route-returnurl="#ViewBag.ReturnUrl" method="post" role="form">
#Html.AntiForgeryToken()
<div class="box box-primary col-xs-12 boxShadow" style="border:none;margin-bottom:10px;">
<div class="form-group has-feedback col-xs-12 noPadding">
<label>Name</label>
<input asp-for="#Model.FullName" value="#Model.FullName" class="form-control" />
<span asp-validation-for="#Model.FullName" class="text-danger"></span>
</div>
</form>
</div>
</div>
<div class="container-fluid">
<div class="content-frame purple2-bg">
<div class="container-fluid support-block">
<div class="row icon-row">
<div class="col-md-4">
<i class="fa fa-tag" style="font-size:155px;" aria-hidden="true"></i>
<div class="text-holder">
<strong class="name">Example</strong><br />
Example
</div>
</div>
<div class="col-md-4">
<i class="fa fa-thumbs-up" style="font-size:155px;" aria-hidden="true"></i>
<div class="text-holder">
<strong class="name">Example</strong><br />
Example
</div>
</div>
<div class="col-md-4">
<i class="fa fa-money" style="font-size:155px;" aria-hidden="true"></i>
<div class="text-holder">
<strong class="name">Example</strong><br />
Example
</div>
</div>
</div>
</div>
</div>
</div>
However, under the form I want a complete new section but the content from the form and everything else seems to just float about on the page! Anybody know why this is happening?
Here is how it looks in the browser
This container should be taking up the full width of the screen but it's just floating around. Any idea as to why this is happening?
I have a 3 col set up and when the page loads the two outer columns get pushed to the bottom of the screen. I can't move them using margins and believe it may be related to the center column which imports an external feed. I've spent hours on this with no resolution in sight. Any help would be extremely grateful for. webpage http://carrickswan.com/fix-test/
Sorry about the inline css it makes it look messy but hopefully someone can see the issue from the live page.
<!-- col 1 -->
<div style="background-color: white; width: 18%; margin: 25px 20px 0px 40px; display:inline-block;">
<div>
<h2 style="width: inherit; color: white; background-color: #2e2d2d; padding: 5px; background-image: url('http://carrickswan.com/wp-content/uploads/2016/04/header-bg2.png');
background-repeat: no-repeat;
background-position: right;" class="col-title">PLAY ONLINE</h2>
<img src="http://carrickswan.com/wp- content/uploads/2016/04/pay.jpg" alt="play swan lotto">
</div>
<div>
<h2>MEMBERSHIP</h2>
<img src="http://carrickswan.com/wp-content/uploads/2016/04/membership.jpg" alt="pay swan membership">
</div>
</div>
<!-- col 2 -->
<div id="content" style="background-color: white; width: 50%; display:inline-block; margin: 25px;">
<div id="content_fixtures"></div>
</div>
<!-- col 3 -->
<div style="width: 18%; display: inline-block; margin-top: 0px; background-color: white;">
<h2 class="title" style="color:white; background-color: #2e2d2d; padding: 5px; background-image: url('http://carrickswan.com/wp- content/uploads/2016/04/header-bg2.png'); background-repeat: no-repeat;
background-position: right;">LOTTO</h2>
<?php $cat_id = 7; //the certain category ID
$latest_cat_post = new WP_Query( array('posts_per_page' => 1, 'category__in' => array($cat_id)));
if( $latest_cat_post->have_posts() ) : while( $latest_cat_post->have_posts() ) : $latest_cat_post->the_post(); ?>
<h2 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" ><?php the_title(); ?></a></h2>
<div style="padding:5px;">
<?php the_content($more_link_text,$strip_teaser); ?>
Read More
</div>
<?php endwhile; endif; ?>
</div>
Add vertical-align: top; to the two outer divs - I tried it on your page and it worked.
if you don't want to make them align top
here is the solution
wrap your 3 divs within container
<div class="main-container">
<div class="column one">
<div class="column two">
<div class="column three">
</div>
CSS
.main-container
{
display:flex;
}
.main-container .column
{
flex:1;
}