Issue
Trying to have it to where these elements appear on the same exact line. So the header of "Header" will be on the left and the button to submit will be on the right.
<div>
<div width="float: left; width: 50%">
<h4> Header </h4>
</div>
<div style="float: right; width: 50%">
<button> Export to Excel </button>
</div>
</div>
I have used similar setup in the past and it worked. Any ideas?
Solution
To align two items next to eachother you need to make sure you assign them both a 50% width
and you can get them both on the same line using align: left
. This method works, but I suggest looking into flexbox for positioning, this makes it much easier.
.wrapper {
width: 50%;
float: left;
}
<div>
<div class="wrapper">
<h4>
Header
</h4>
</div>
<div class="wrapper">
<button
cButton
(click)="exportExcel(1)"
>
Export to Excel
</button>
</div>
</div>
Flexbox:
.parent {
display: flex;
flex-direction: row;
flex-wrap: wrap;
width: 100%;
}
.wrapper {
flex-direction: column;
flex: 1;
}
.wrapper button {
width: 125px;
}
<div class="parent">
<div class="wrapper">
<h4>
Header
</h4>
</div>
<div class="wrapper">
<button
cButton
(click)="exportExcel(1)"
>
Export to Excel
</button>
</div>
</div>
Answered By - FUZIION
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.