<div class="account-tile" qa-name="accountBlock">
<a
*ngIf="link"
class="account-detail-header"
[routerLink]="'/AccountDetails/' + account.index!"
>
<div qa-name="accountName" class="account-name">
{{ account.accountName }}
</div>
<div qa-name="accountNumber" class="account-number">
...{{ account.number | lastFour }}
</div>
<span>
<i class="gg-chevron-right"></i>
</span>
</a>
<div *ngIf="!link" class="account-detail-header">
<div qa-name="accountName" class="account-name">
{{ account.accountName }}
</div>
<div qa-name="accountNumber" class="account-number">
...{{ account.number | lastFour }}
</div>
</div>
<div class="available-balance-container">
<div class="flex">
<span class="negative-account" *ngIf="account.availableBalance! < 0"
>-</span
>
<span
[ngClass]="link ? 'format-dollar-link' : 'format-dollar-display'"
class="format-dollar"
>
$
</span>
<h2 qa-name="availableBalance">
{{ account.availableBalance | currency: '':'' | absolute }}
</h2>
<!--This is wheere the transfer button appears-->
<div class="parent=class">
<button class="button-right pull-right">Transfer</button>
</div>
</div>
<h3>Available Balance</h3>
</div>
</div>
I am trying to display a transfer button at the right corner to look like the picture above. How can I accomplish that? I tried creating a button and a class that pulls the button to the right. when I compile the code, the transfer button shows underneath the Account amount
You can add position: absolute to your transfer button.
.parent-class {
position: relative;
height: 100px;
border: 1px solid red;
}
.button-right {
position: absolute;
right: 10px;
}
<div class="parent-class">
<button class="button-right">Transfer</button>
</div>
I have a block of text where I want to group words up as pairs so the two words do not break. There is an unintended consequence where when you have two <span></span> tags in a row he whole line turns into nowrap.
Example: <div><span style="white-space: nowrap;">...</span><span style="white-space: nowrap;">...</span></div>
Code below is baseline: The result will wrap at any " "(space) or "-" that the container has.
(NOTE: This example is meant to be on a responsive web-page.)
<div class="block-of-text" style="max-width: 550px">
One-two Buckle-my-shoe, Three-four Shut-the-door,
Five-six Pick-up-sticks, Seven-eight Lay-them-straight,
Nine-ten Do-it-again.
</div>
The Result of the Base line will look something like this.
|--------------- My Web Page ---------------| (550px)
| |
| One-two Buckle-my-shoe, Three-four Shut- |
| the-door, Five-six Pick-up-sticks, Seven-|
| eight Lay-them-straight, Nine-ten Do-it- |
| again. |
| |
|-------------------------------------------|
I want to make sure any hyphenated word surrounded by <span class="nowrap">...</span> stays on the same line.
Below is my attempt. (NOTE: I have One-two not surrounded by nowrap on purpose to show how it will not be included in the result.)
<style>
.nowrap {
white-space: nowrap;
}
</style>
<div class="block-of-text" style="max-width: 550px">
One-two <span class="nowrap">Buckle-my-shoe, </span>
<span class="nowrap">Three-four </span><span class="nowrap">Shut-the-door, </span>
<span class="nowrap">Five-six </span><span class="nowrap">Pick-up-sticks, </span>
<span class="nowrap">Seven-eight </span><span class="nowrap">Lay-them-straight, </span>
<span class="nowrap">Nine-ten </span><span class="nowrap">Do-it-again.</span>
</div>
My unintended result looks something like this and is NOT what I want. The <span> tags are acting as one giant nowrap.
|--------------- My Web Page ---------------| (550px)
| |
| One-two |
| Buckle-my-shoe, Three-four Shut-the-door, Five-six Pick-up-sticks, Seven-eight Lay-them-straight, Nine-ten Do-it-again.
| |
|-------------------------------------------|
What I want to have happen:
|--------------- My Web Page ---------------| (550px)
| |
| One-two Buckle-my-shoe, Three-four |
| Shut-the-door, Five-six Pick-up-sticks, |
| Seven-eight Lay-them-straight, Nine-ten |
| Do-it-again. |
| |
|-------------------------------------------|
SOLUTION
Thanks to everyone and especially #Kravimir for helping find the solution:
It works when adding style display: inline-block;, while having all spans on the same line, and adding spacing with inside the span.
<style>
.nowrap {
white-space: nowrap;
display: inline-block;
}
</style>
<div class="block-of-text" style="max-width: 550px; border: solid 1px red">
One-two <span class="nowrap">Buckle-my-shoe, </span><span class="nowrap">Three-four </span><span class="nowrap">Shut-the-door, </span><span class="nowrap">Five-six </span><span class="nowrap">Pick-up-sticks, </span><span class="nowrap">Seven-eight </span><span class="nowrap">Lay-them-straight, </span><span class="nowrap">Nine-ten </span><span class="nowrap">Do-it-again.</span>
</div>
Additional info on solution: If you put " "(space) or outside of the span it does not work as intended or you get 2 spaces between spans. Also the whitespace at the end of a line is not observed when the <span> tag is on a new line.
TLDR; Solution was edited in above.
Use display: inline-block.
span.nowrap {
white-space: nowrap;
display: inline-block;
}
<div class="block-of-text" style="max-width: 550px">
One-two <span class="nowrap">Buckle-my-shoe,</span>
<span class="nowrap">Three-four</span> <span class="nowrap">Shut-the-door,</span>
<span class="nowrap">Five-six</span> <span class="nowrap">Pick-up-sticks,</span>
<span class="nowrap">Seven-eight</span> <span class="nowrap">Lay-them-straight,</span>
<span class="nowrap">Nine-ten</span> <span class="nowrap">Do-it-again.</span>
</div>
This occurs because, without spaces between the spans, they act as characters in a single word. You need to put spaces between the spans, not inside them.
.nowrap {
white-space: nowrap;
}
<div class="block-of-text" style="max-width: 550px; border: 1px solid red">
One-two <span class="nowrap">Buckle-my-shoe,</span> <span class="nowrap">Three-four</span> <span class="nowrap">Shut-the-door,</span> <span class="nowrap">Five-six</span> <span class="nowrap">Pick-up-sticks,</span> <span class="nowrap">Seven-eight</span> <span class="nowrap">Lay-them-straight,</span> <span class="nowrap">Nine-ten</span> <span class="nowrap">Do-it-again.</span>
</div>
You are not closing span so
.nowrap {
white-space: nowrap;
}
<div class="block-of-text" style="max-width: 550px">
One-two <span class="nowrap">Buckle-my-shoe, </span>
<span class="nowrap">Three-four </span><span class="nowrap">Shut-the-door, </span>
<span class="nowrap">Five-six </span><span class="nowrap">Pick-up-sticks, </span>
<span class="nowrap">Seven-eight </span><span class="nowrap">Lay-them-straight, </span>
<span class="nowrap">Nine-ten </span><span class="nowrap">Do-it-again.</span>
</div>
I tried to add a row to the bottom of my Div Thumbnail but I can't seem to get it right, nor find a working answer.
<div class="item col-lg-4">
<div class="thumbnail">
<div class="caption">
<h4 class="list-group-item-heading"><?php echo $row["name"]; ?></h4>
<p class="list-group-item-text"><img style="width: 100%; padding-bottom: 10px;" border="0" src="<?php echo $row["description"]; ?>"></p>
<div class="row">
<div class="col-md-6 ">
<p class="lead"><?php echo '€'.$row["price"].' EURO'; ?></p>
</div>
<div class="col-md-6 ">
<a class="btn btn-success" href="cartAction.php? action=addToCart&id=<?php echo $row["id"]; ?>">Add to cart</a>
</div>
</div>
</div>
</div>
</div>
most likely if you put this in a normal code it wont give back anything at all. because it gets info from a sql database. but it gives back something like this:
|================| |================|
| picture | | picture |
| | | |
| - | | - |
| | but i want it to be like. | |
| price, button | | |
| | | |
| | | |
| | | |
| | | price, button |
|================| |================|
the problem is. adding an extra class to the row and giving it vallign bottom, or just bottom: 0px; does not work.
the big form is the Thumbnail, and the price and button are in a row. so u know what that form is might it be useful info.
sorry for bad english, not my native language.
and really sorry if this answer is to obvious but I'm new to bootstrap.
This may be what you need:
.thumbnail {
position: relative;
height: 300px; /* Replace with your desired thumbs height */
}
.row-bottom {
position: absolute;
bottom: 0;
width: 100%;
}
Check this example
I want like this:
| |
| |
| |
| |
|left right|
| |
It's on the footer and one is left,the other is on the right.
My code failed to do it. How to solve it?
<div style="height:15%;position:absolute;bottom:0px;width=100%">
<div style="float:left;left:0;width:100px;border:1px solid red">footer leftest</div>
<div style="float:right;right:0;width:100px;border:1px solid green;">footer rightest </div>
</div>
http://jsfiddle.net/gclsoft/xdUdE/
You just have a typo: width=100% should be width:100%
An example : http://jsfiddle.net/xdUdE/1/
Use text-align if you want to align inline elements like text or pictures:
<div style="height:15%;position:absolute;bottom:0px;">
<div style="float:left;text-align:left;width:100px;border:1px solid red">left</div>
<div style="float:left;text-align:right;width:100px;border:1px solid green;">right</div>
</div>
I have a 2 forms which are both nested in a containing div. I am trying to place both forms(and their containing divs) side by side via the use of floats.
While i am able to do so successfully, upon closer examination of the containing divs using chrome's developer tools, i noticed that while my forms are placed apart from each other, the margins specified the the css are being applied to the forms inside the containing divs and not on the containing div, though it was specified in the css for the containing div.
HTML(Extract)
<div id='UserRegistrationContainer'>
<div id='UserRegistrationCover' class='RegistrationFormCover'>
<input type='button' id='UserSignUp' value='Sign up today!' />
</div>
<form id='UserRegistration' class='RegistrationForm' method='POST' action='#'>
//Form inputs/details here
</form>
</div>
<div id='ShopRegistrationContainer'>
<div id='ShopRegistrationCover' class='RegistrationFormCover'>
<input type='button' id='ShopSignUp' value='Sign up today!' />
</div>
<form id='ShopRegistration' class='RegistrationForm' method='POST' action='#'>
//Form inputs/details here
</form>
</div>
CSS
.RegistrationFormCover{
position:absolute;
width: 100%;
height: 100%;
background: #0000CC;
z-index: 100; }
#UserRegistrationContainer{
position: relative;
float:left;
width:40%; }
#UserRegistration{
display:inline-block; }
#ShopRegistrationContainer{
position: relative;
float:left;
width:40%;
margin-left: 50px; }
#ShopRegistration{
display:inline-block; }
Visual example
Why am i getting this
<UserRegistrationContainer><------ShopRegistration Container-------------->
---------------------------------------------------------------------------
| | |
| | |
| | |
| 50px | |
UserRegistration | <--margin --> | ShopRegistration |
| | |
| | |
| | |
---------------------------------------------------------------------------
and not getting this?
<UserRegistrationContainer> <--ShopRegistration Container-->
---------------------------------------------------------------------------
| | |
| | |
| | |
| 50px | |
UserRegistration | <--margin --> | ShopRegistration |
| | |
| | |
| | |
---------------------------------------------------------------------------
jsfiddle: http://jsfiddle.net/x6SfW/
I think your first issue is that so many of your divs have their position property set as well as float property. All of those css styles have very specific uses and from what I can tell they are not entirely necessary for what you are trying to accomplish, two vertically aligned divs with each with two sections that take up ~80% of the page.
First lets look at the HTML.
<div id="userRegistration" class="registration">
<div>
<input type='button' value='Sign up today!' />
</div>
<form method='POST' action='#'>
//Form inputs/details here
</form>
</div>
<div id="shoppingRegistration" class="registration">
<div>
<input type='button' value='Sign up today!' />
</div>
<form method='POST' action='#'>
//Form inputs/details here
</form>
</div>
Removed extra tags ids and classes which are unnecessary.
Next up is the CSS.
.registration div{ //replaces RegistrationFormCover
width: 100%;
height: 100%;
background: #0000CC;
z-index: 100;
}
.registration {
width: 40%;
float: left;
position: relative;
}
.registration form {
display: inline-block;
}
#shoppingRegistration{
margin-left: 50px;
}
As to your actual problem right now I just realized you probably just miss read the chrome developer tools. The orange color represents a margined area not an actual piece of the div.
Either way the code here works so good luck and I hope it helps you.