I've got an icon 'X' that shows in corner of button when button is hovered. Problem is I can't click on it for some reason, like element doesnt even exist. Here is html:
<button *ngIf="favapps.indexOf('qualitydocs') >= 0" (mouseover)="showQualitydocs = true" (mouseleave)="showQualitydocs = false" class="btn btn-sq btn-primary text-center"
[routerLink]="['/dokumenti-kvalitete']">
<i class="fa fa-file-text-o inside fa-2x" aria-hidden="true"></i>
<br>Dokumenti
<br> kvalitete
<span class="relative-qualitydocs"><span class="absolute-qualitydocs" *ngIf="showQualitydocs" (mouseover)="showQualitydocs = true" (mouseleave)="showQualitydocs = false"><i class="fa fa-close"></i></span></span>
</button>
and css:
.absolute-qualitydocs {
z-index: 100;
position: absolute;
top: 22px;
background: #fff;
border: 1px solid #67809F;
padding: 0 3px;
cursor: pointer;
color: #67809F;
&:hover {
background-color: #d1d1d1;
}
}
.relative-qualitydocs {
position: relative;
cursor: pointer;
left: -67px;
top: -67px
}
As you can see on the picture it shows correctly, but I cant click on it, I cant hover it, even cursor: pointer doesn't work. Any ideas what might be wrong? Tried putting z-index and display: block, didn't help.
Screenshot:
Try this HTML and CSS
.delete-hover {
z-index: 100;
background: #fff;
border: 1px solid #67809F;
padding: 0 3px;
cursor: pointer;
color: #67809F;
}
.delete-hover:hover {
background-color: #d1d1d1;
}
.relative-qualitydocs {
position: relative;
cursor: pointer;
}
.absolute-qualitydocs {
position: absolute;
top: 0;
left: -18px;
}
<button class="btn btn-sq btn-primary text-center relative-qualitydocs">
<i class="fa fa-file-text-o inside fa-2x" aria-hidden="true"></i>
<br>Dokumenti
<br> kvalitete
<span class="delete-hover absolute-qualitydocs" *ngIf="showQualitydocs" (mouseover)="showQualitydocs = true" (mouseleave)="showQualitydocs = false">×</span>
</button>
Fixed it by putting 'span' ('div' also works) as a parent element instead of 'button' ... if anyone has a clue why this happens, please share cause i have no clue... here is working pen
<button class="parent-relative"> <!-- doesnt work -->
<span class="child-absolute"></span>
</button>
<span class="parent-relative"> <!-- works -->
<span class="child-absolute"></span>
</span>
css:
.parent-relative {
position:relative;
padding: 200px;
background: red;
margin:50px;
}
.child-absolute {
position:absolute;
padding:20px;
background:yellow;
cursor:pointer;
top: 0;
left:-40px;
}
Related
Hi I'm trying to add a colored border to my 'dreams-anchor-wrap' div but can't seem to be able to use any CSS on it for some reason and I'm not sure why. Is it not possible to wrap a div around an anchor tag and then add CSS properties to it?
here's the link to my sandbox code:
https://codesandbox.io/s/unruffled-jones-0v0xj?file=/src/App.js
You just misspelled className on 'dreams-anchor-wrap' div.Correct your mistake and should work
You have to write your classes like "class" not className.
Then it will be run correctly.
* {
margin: 0;
border: 0;
padding: 0;
}
.dream-homes-container {
display: flex;
justify-content: center;
}
.dream-home-card {
margin: 0 auto;
padding: 15px;
width: 200px;
height: 100%;
}
.dream-homes-container :last-child {
padding-right: 0;
}
.dream-home-card img {
width: 100%;
height: 70%;
}
.property-info {
width: 100%;
color: black;
padding: 0 0 5px 10px;
}
.dream-home-card a {
text-decoration: none;
width: 100%;
}
.num-specs-margin {
margin-right: 10px;
}
.dream-anchor-wrap {
border:2px solid blue;
}
.dream-homes-wrap {
margin-bottom: 50px;
}
<div class="App">
<div class="dream-home-card">
<a href="#">
<div class="dream-anchor-wrap">
<img src="https://images.pexels.com/photos/2343466/pexels-photo-2343466.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" />
<div class="property-info">
<h4>Pent Suite</h4>
<div class="property-specs">
<i class="fas fa-bed"></i>
<span class="num-beds num-specs-margin">4</span>
<i class="fas fa-shower "></i>
<span class="num-baths num-specs-margin">2</span>
<i class="fas fa-car"></i>
<span class="num-cars ">2</span>
</div>
</div>
</div>
</a>
</div>
</div>
I had upgraded my rating plugin with font awesome icons instead of images. I am facing problem on half star rated which I can't replace white color on the fa-star-half-o icon. I would like to replace the white color with grey color similar to expected result below.
Please help
Code :
<div class="ratingbox"><i class="fa fa-star"></i><i class="fa fa-star">
</i><i class="fa fa-star-half-o"></i><i class="fa fa-star unrated"></i>
<i class="fa fa-star enlang unrated"></i></div>
i
{
float:left
}
.ratingbox
{
display: block;
clear: both;
}
.fa-star-half-o,.fa-star
{
color: #ffab00;
}
.rated{
color: #ffab00;
cursor: pointer;
}
.unrated{
color: #757575;
cursor: pointer;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="ratingbox">
<i class="fa fa-star"></i><i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i><i class="fa fa-star unrated"></i><i class="fa fa-star enlang unrated"></i>
</div>
Current Result
Expected Result
Everything is possible in web design but maybe you manage to use some trick:
i
{
float:left;
position: relative;
}
.ratingbox
{
display: block;
clear: both;
}
.fa-star-half-o,.fa-star
{
color: #ffab00;
}
.rated{
color: #ffab00;
cursor: pointer;
}
.unrated{
color: #757575;
cursor: pointer;
}
.fa-star-half-empty:after, .fa-star-half-full:after, .fa-star-half-o:after {
content: "\f123";
transform: rotateY(-180deg);
display: inline-block;
left: 6px;
position: absolute;
top: 0;
color: #757575;
overflow: hidden;
width: 8px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="ratingbox">
<i class="fa fa-star"></i><i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i><i class="fa fa-star unrated"></i><i class="fa fa-star enlang unrated"></i>
</div>
Note: I just add fa-star-half-o character to after element, i mean this content: "\f123"; then reverse it transform: rotateY(-180deg); and half width and absolute position you can see what's happened here:
.fa-star-half-empty:after, .fa-star-half-full:after, .fa-star-half-o:after {
content: "\f123";
transform: rotateY(-180deg);
display: inline-block;
left: 6px;
position: absolute;
top: 0;
color: #757575;
overflow: hidden;
width: 8px;
}
It's not clean but better than nothing!
You can use CSS ::before and ::after pseudo-elements refer here for CSS unicodes.
Add an extra .unrated star
Add 2 pseudo-elements to the half-o ; ::before and ::after
Make sure that the pseudo-elements are absolute and the half-o is relative.
And to cleanly fill the rightside of half star, explicitly set the ::before pseudo-element to color:grey.
Demo
i {
float: left;
}
.ratingbox {
display: block;
clear: both;
}
.fa-star-half-o,
.fa-star {
color: #ffab00;
}
.rated {
color: #ffab00;
cursor: pointer;
}
.unrated {
color: #757575;
cursor: pointer;
}
.fa-star-half-o {
position: relative;
}
.fa-star-half-o:after {
font-family: FontAwesome;
content: '\f089';
position: absolute;
z-index: 1;
}
.fa-star-half-o:before {
font-family: FontAwesome;
content: '\f089';
position: absolute;
color: grey;
z-index: 1;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<div class="ratingbox">
<i class="fa fa-star"></i><i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i><i class="fa fa-star unrated"></i><i class="fa fa-star unrated"></i><i class="fa fa-star unrated"></i>
</div>
I am trying to make a search field with a dropdown inside. I have been trying to use bootstrap's input group to give the illusion that the button is inside the field.
This is what I am trying to accomplish in the screenshot below:
This is what I have so far:
I am trying to figure out how to get the dropdown menu to move over to the far right of the search field and get that carrot to show as well.
Any tips on adjusting the position of the menu as well as making that dropdown button have no color on hover?
<div class="container div-cntr">
<div class="form-group">
<div class="input-group">
<input type="text" class="form-control input-lg" id="toolSearch" name="toolSearch" placeholder="What are you looking for?">
<div class="input-group-btn">
<button aria-expanded="false" aria-haspopup="true" data-toggle="dropdown" class="btn btn-default btn-lg dropdown-toggle filterOptions" type="button"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span> </button>
<ul class="dropdown-menu">
<li><input type="checkbox"/> Option 1</li>
<li><input type="checkbox"/> Option 2</li>
</ul>
</div>
</div>
<br />
<button type="button" class="btn btn-default btn-lg">Search</button>
</div>
</div>
-
.div-cntr {
left: 50%;
margin-left: -350px;
margin-top: -150px;
min-height: 150px;
position: absolute;
text-align: center;
top: 50%;
width: 700px;
}
.filterOptions{
border-left: 0px;
}
.btn-lg {
line-height: 1.22;
}
#toolSearch:focus {
outline:none;
}
Here is a fiddle I have set up: https://jsfiddle.net/carlhussey/tfrpncu7/
Here is the CSS you need to accomplish what you indicated you wanted:
.dropdown-menu {
right: 0; /* Align dropdown-menu to right instead of left */
left: auto;
}
.input-group .dropdown-toggle.filterOptions {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
z-index: 5; /* Fix for 2 input-group-btns and this one not being the last-child */
}
.dropdown-menu>li>a:focus,
.dropdown-menu>li>a:hover {
background-color: transparent; /* Fix for dropdown-menu item hover background-color */
}
Here is what it looks like:
I went ahead and updated your Fiddle:
https://jsfiddle.net/tfrpncu7/3/
You should be using input-group-lg along with input-group and dropdown-menu-right to position the dropdown menu correctly. For the other CSS use pseudo elements.
Working Example: (The level of specificity is so the example works on Stackoverflow.)
.div-cntr {
margin-top: 100px;
text-align: center;
max-width: 700px;
/*for example only*/
background: red;
min-height: 300px;
/*for example only*/
}
.form .open>.dropdown-toggle.filterOptions.focus,
.form .open>.dropdown-toggle.filterOptions:focus,
.form .open>.dropdown-toggle.filterOptions:hover .input-group-lg>.form-control,
.form .input-group.input-group-lg>.input-group-btn>.filterOptions {
border: 1px solid #ccc;
border-left: 0;
outline: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border-radius: 0;
background: #fff;
}
.form .dropdown-menu.dropdown-menu-search {
top: 60px;
right: 110px;
border-radius: 0;
border: 0;
background: #fff;
}
.form .dropdown-menu.dropdown-menu-search:after {
top: -15px;
right: 10px;
position: absolute;
content: '';
border-width: 0px 15px 15px 15px;
border-style: solid;
border-color: #fff transparent;
height: 0;
width: 0;
}
.form .form-control.toolSearch,
.form .form-control.toolSearch:focus {
outline: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border-radius: 0;
border: 1px solid #ccc;
border-right: 0;
}
.form .input-group-btn .btn.btn-search,
.form .input-group-btn .btn.btn-search.active {
border-radius: 0;
border: 1px solid #ccc;
border-left: 0;
}
.form .input-group-btn .btn.btn-search:hover,
.form .input-group-btn .btn-search:focus {
outline: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border: 1px solid #ccc;
border-left: 0;
border-radius: 0;
background: #fff;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="container div-cntr">
<div class="form-group form">
<div class="input-group input-group-lg">
<input type="text" class="form-control toolSearch" id="toolSearch" name="toolSearch" placeholder="What are you looking for?">
<div class="input-group-btn">
<button aria-expanded="false" aria-haspopup="true" data-toggle="dropdown" class="btn btn-default btn-lg dropdown-toggle filterOptions" type="button"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu dropdown-menu-right dropdown-menu-search">
<li>
<a href="#" class="small" data-value="option1" tabIndex="-1">
<input type="checkbox" /> Option 1</a>
</li>
<li>
<a href="#" class="small" data-value="option2" tabIndex="-1">
<input type="checkbox" /> Option 2</a>
</li>
<li>
<a href="#" class="small" data-value="option3" tabIndex="-1">
<input type="checkbox" /> Option 3</a>
</li>
<li>
<a href="#" class="small" data-value="option4" tabIndex="-1">
<input type="checkbox" /> Option 4</a>
</li>
<li>
<a href="#" class="small" data-value="option5" tabIndex="-1">
<input type="checkbox" /> Option 5</a>
</li>
<li>
<a href="#" class="small" data-value="option6" tabIndex="-1">
<input type="checkbox" /> Option 6</a>
</li>
</ul>
<button role="button" class="btn btn-lg btn-default btn-search"><span class="glyphicon glyphicon-search"></span> Search</button>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
Here's a Fiddle with the position of the dropdown set, and the button with a white background on `:active'. Let me know if this is what you were looking for.
https://jsfiddle.net/tobyl/4p41p3kg/2/
Added CSS:
.dropdown-menu {
left: auto;
right: 0;
}
.open > .dropdown-toggle.btn-default:active, .open > .dropdown-toggle.btn-default:focus {
background-color: #fff;
}
I'll start by answering the second part of your question
Making that dropdown button have no color on hover
Chrome dev-tools (right click any element of the page and select Inspect element) can help a lot when it comes to styling elements under certain states (like hover). To see which style rule is applied during hover we can force the hover state on the button through dev-tools. We see that .btn-default is applying
.btn-default:hover {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
Since this button has the following class precedence
<button class="btn btn-default btn-lg dropdown-toggle filterOptions"> (classes to the right override rules from classes to the left)
We can override the hover styles of .btn-default by making a rule for the hover state of filterOptions.
.filterOptions:hover {
background-color: white;
border-color: #ccc;
}
Adjusting the position of the menu as well as
Again by inspecting the dropdown element in dev-tools we can see that the correct style rule to override the default positioning and make the dropdown position to the right would be:
.open>.dropdown-menu {
right: 0;
left: initial;
}
Updated fiddle:
https://jsfiddle.net/tfrpncu7/4/
Remember, css has no scoping what so ever so it's a good idea to always apply new non-bootstrap classes when styling a specific element.
If your project is large, consider using a css naming convention like BEM to keep the risk of naming collisions low.
I have six <sections> that are all rows within a flexbox wrapper. Flex-direction is set to column. Each <section> (row) has 3 <spans>, one <img>, one <i> and a <time> element, which are aligned within each <section> using position relative/absolute, using distances from the edges of the <section> element. I want to make entire <section> a link so that when a user mouses over it, the background color changes.
What's the best way to do this? I had considered making the section an <a> element and displaying it as a block but am unsure if this is even possible.
<section class="conversations-history-section">
<span class="conversations-history-section-row-selected"></span>
<img class="conversations-history-section-row-image" src="assets/images/profileimg1.png" alt="img">
<span class="conversations-history-section-row-user">
<span class="conversations-history-section-row-status online"></span>
<span class="conversations-history-section-row-name active">Lucile B. Nash</span>
<span class="conversations-history-section-row-location">Vancouver, BC</span>
</span>
<time class="conversations-history-section-row-date">8:48 AM</time>
<i class="fa fa-e1-message-success conversations-history-section-row-message"> </i>
<span class="conversations-history-section-row-snippet">Hey, it was really good to see you over the weekend, I look forward to...</span>
</section>
.conversations-history-section {
position: relative;
min-height: 140px;
max-height: 140px;
width: 400px;
color: $e1-conversations-history-section-text;
font-size: 13px;
border-bottom: 1px solid $e1-body-1px-line;
}
.conversations-history-section-row-selected {
position: absolute;
display: block;
width: 5px;
height: 140px;
left: 0px;
background-color: $e1-conversations-history-section-selected;
}
.conversations-history-section-row-selected.not {
background-color: $e1-conversations-history-wrapper-bg;
}
.conversations-history-section-row-user {
display: block;
position: relative;
max-width: 50%;
top: 20px;
left: 90px;
}
.conversations-history-section-row-image {
display: block;
position: absolute;
left: 29px;
top: 20px;
border-radius: 50%;
height: 46px;
width: 46px;
}
.conversations-history-section-row-status {
position: absolute;
display: block;
top: 8px;
left: 0px;
width: 8px;
height: 8px;
border-radius: 4px;
}
.conversations-history-section-row-status.online {
background-color: $e1-conversations-history-section-status-online;
}
.conversations-history-section-row-status.offline {
background-color: $e1-conversations-history-section-status-offline;
}
.conversations-history-section-row-name {
position: absolute;
display: block;
top: 0px;
left: 16px;
color: $e1-conversations-history-section-user-name;
font-weight: bold;
font-size: 13px;
}
.conversations-history-section-row-name.active {
color: $e1-conversations-history-section-user-name-active;
}
.conversations-history-section-row-location {
position: absolute;
display: block;
top: 20px;
left: 16px;
font-size: 11px;
}
.conversations-history-section-row-date {
position: absolute;
top: 20px;
right: 24px;
}
.conversations-history-section-row-message {
display: block;
position: absolute;
right: 24px;
bottom: 24px;
color: $e1-conversations-history-section-row-message;
font-size: 16px;
}
.conversations-history-section-row-message.error {
color: $e1-conversations-history-section-row-message-error;
}
.conversations-history-section-row-snippet {
display: block;
position: absolute;
width: 350px;
left: 24px;
bottom: 24px;
}
you have to wrap the section in a and most likely make that a a block level element.
a {
/* optional */
display: block
}
a:hover {
background: red
}
.conversations-history-section {
position: relative;
min-height: 140px;
max-height: 140px;
width: 400px;
color: $e1-conversations-history-section-text;
font-size: 13px;
border-bottom: 1px solid $e1-body-1px-line;
}
.conversations-history-section-row-selected {
position: absolute;
display: block;
width: 5px;
height: 140px;
left: 0px;
background-color: $e1-conversations-history-section-selected;
}
.conversations-history-section-row-selected.not {
background-color: $e1-conversations-history-wrapper-bg;
}
<a href="#">
<section class="conversations-history-section">
<span class="conversations-history-section-row-selected"></span>
<img class="conversations-history-section-row-image" src="assets/images/profileimg1.png" alt="img">
<span class="conversations-history-section-row-user">
<span class="conversations-history-section-row-status online"></span>
<span class="conversations-history-section-row-name active">Lucile B. Nash</span>
<span class="conversations-history-section-row-location">Vancouver, BC</span>
</span>
<time class="conversations-history-section-row-date">8:48 AM</time>
<i class="fa fa-e1-message-success conversations-history-section-row-message"> </i>
<span class="conversations-history-section-row-snippet">Hey, it was really good to see you over the weekend, I look forward to...</span>
</section>
</a>
If you don't want to link the section anywhere, then you can just :hover the section instead without adding extra HTML.
section:hover {
background: red
}
.conversations-history-section {
position: relative;
min-height: 140px;
max-height: 140px;
width: 400px;
color: $e1-conversations-history-section-text;
font-size: 13px;
border-bottom: 1px solid $e1-body-1px-line;
}
.conversations-history-section-row-selected {
position: absolute;
display: block;
width: 5px;
height: 140px;
left: 0px;
background-color: $e1-conversations-history-section-selected;
}
.conversations-history-section-row-selected.not {
background-color: $e1-conversations-history-wrapper-bg;
}
<section class="conversations-history-section">
<span class="conversations-history-section-row-selected"></span>
<img class="conversations-history-section-row-image" src="assets/images/profileimg1.png" alt="img">
<span class="conversations-history-section-row-user">
<span class="conversations-history-section-row-status online"></span>
<span class="conversations-history-section-row-name active">Lucile B. Nash</span>
<span class="conversations-history-section-row-location">Vancouver, BC</span>
</span>
<time class="conversations-history-section-row-date">8:48 AM</time>
<i class="fa fa-e1-message-success conversations-history-section-row-message"> </i>
<span class="conversations-history-section-row-snippet">Hey, it was really good to see you over the weekend, I look forward to...</span>
</section>
Yes, it is a valid solution to transform your section into an <a> and make it act as a block :
.container a {
display: block;
}
Following up on Matthieu Schaeffer's answer, I've done something like this (in plain HTML rather the more general XML, but it should work the same).
a.conversations-history-section {
display: block;
background-color: green:
}
.conversations-history-section:hover {
background-color: blue:
}
When you hover over the section, the background should turn from green to blue, or whatever colors you want.
Just one warning: make your that your schema allows putting all those elements (e.g., <time>) inside your <a> element. If your XML doesn't match your schema, the browser may do strange things. I'd recommend using an XML validator (online or downloadable).
NOTE: My code does not obey the XHTML schema, e.g., block-level elements <p> and <ul> inside an <a>. It works as shown, but when I tried putting a second-level <a> inside one of the paragraphs, only part of the text had the correct background.
This is based on the "salmon book": Cascading Style Sheets from O'Reilly, page 53 (section title "Pseudo-Class Selectors", subsection "Dynamic pseudo-classes")
Here is the code I used to test this:
<html>
<head>
<title>title</title>
<style type="text/css">
a.section {
display: block;
background-color: #8f8;
text-decoration: none;
color: black;
}
.section:hover {
background-color: #88f;
}
a.section a {
text-decoration: underline;
color: red;
display: inline;
}
a.section a:visited {
display: inline;
color: silver;
}
</style>
</head>
<body>
<div class="all">
<a href="#" class="section">
<p>This is the first paragraph<br/>
And a second line.
</p>
<ul>
<li>abc</li>
<li>def</li>
<li>ghi</li>
<li>xyz</li>
</ul>
<p>This is the second paragraph
</p>
</a>
</div>
</body>
</html>
If I understand your question correctly, all you really need is this:
section:hover{background-color:wheat;}
jsFiddle Demo
section:hover{background-color:wheat;}
.conversations-history-section {
position: relative;
min-height: 140px;
max-height: 140px;
width: 400px;
color: $e1-conversations-history-section-text;
font-size: 13px;
border-bottom: 1px solid $e1-body-1px-line;
}
.conversations-history-section-row-selected {
position: absolute;
display: block;
width: 5px;
height: 140px;
left: 0px;
background-color: $e1-conversations-history-section-selected;
}
.conversations-history-section-row-selected.not {
background-color: $e1-conversations-history-wrapper-bg;
}
.conversations-history-section-row-user {
display: block;
position: relative;
max-width: 50%;
top: 20px;
left: 90px;
}
.conversations-history-section-row-image {
display: block;
position: absolute;
left: 29px;
top: 20px;
border-radius: 50%;
height: 46px;
width: 46px;
}
.conversations-history-section-row-status {
position: absolute;
display: block;
top: 8px;
left: 0px;
width: 8px;
height: 8px;
border-radius: 4px;
}
.conversations-history-section-row-status.online {
background-color: $e1-conversations-history-section-status-online;
}
.conversations-history-section-row-status.offline {
background-color: $e1-conversations-history-section-status-offline;
}
.conversations-history-section-row-name {
position: absolute;
display: block;
top: 0px;
left: 16px;
color: $e1-conversations-history-section-user-name;
font-weight: bold;
font-size: 13px;
}
.conversations-history-section-row-name.active {
color: $e1-conversations-history-section-user-name-active;
}
.conversations-history-section-row-location {
position: absolute;
display: block;
top: 20px;
left: 16px;
font-size: 11px;
}
.conversations-history-section-row-date {
position: absolute;
top: 20px;
right: 24px;
}
.conversations-history-section-row-message {
display: block;
position: absolute;
right: 24px;
bottom: 24px;
color: $e1-conversations-history-section-row-message;
font-size: 16px;
}
.conversations-history-section-row-message.error {
color: $e1-conversations-history-section-row-message-error;
}
.conversations-history-section-row-snippet {
display: block;
position: absolute;
width: 350px;
left: 24px;
bottom: 24px;
}
<section class="conversations-history-section">
<span class="conversations-history-section-row-selected"></span>
<img class="conversations-history-section-row-image" src="assets/images/profileimg1.png" alt="img">
<span class="conversations-history-section-row-user">
<span class="conversations-history-section-row-status online"></span>
<span class="conversations-history-section-row-name active">Michael Buble</span>
<span class="conversations-history-section-row-location">Vancouver, BC</span>
</span>
<time class="conversations-history-section-row-date">7:59 AM</time>
<i class="fa fa-e1-message-success conversations-history-section-row-message"> </i>
<span class="conversations-history-section-row-snippet">I really enjoyed those singing contests at the PNE every summer..</span>
</section>
<section class="conversations-history-section">
<span class="conversations-history-section-row-selected"></span>
<img class="conversations-history-section-row-image" src="assets/images/profileimg1.png" alt="img">
<span class="conversations-history-section-row-user">
<span class="conversations-history-section-row-status online"></span>
<span class="conversations-history-section-row-name active">Michael J Fox</span>
<span class="conversations-history-section-row-location">Burnaby, BC</span>
</span>
<time class="conversations-history-section-row-date">8:08 AM</time>
<i class="fa fa-e1-message-success conversations-history-section-row-message"> </i>
<span class="conversations-history-section-row-snippet">Christopher Lloyd was better on Taxi, but I sure had great times at Burnaby Central...</span>
</section>
<section class="conversations-history-section">
<span class="conversations-history-section-row-selected"></span>
<img class="conversations-history-section-row-image" src="assets/images/profileimg1.png" alt="img">
<span class="conversations-history-section-row-user">
<span class="conversations-history-section-row-status online"></span>
<span class="conversations-history-section-row-name active">Lucile B. Nash</span>
<span class="conversations-history-section-row-location">Vancouver, BC</span>
</span>
<time class="conversations-history-section-row-date">8:48 AM</time>
<i class="fa fa-e1-message-success conversations-history-section-row-message"> </i>
<span class="conversations-history-section-row-snippet">Hey, it was really good to see you over the weekend, I look forward to...</span>
</section>
When stacking icons, how can I center the second icon?
I'm trying to create a white background for a circle and a checkbox see plnkr example:
http://plnkr.co/5JM1yk6eoeAnj1VgkxXA
<span class="fa-stack">
<i class="fa fa-circle-thin fa-stack-2x"></i>
<i class="fa fa-check-circle fa-stack-2x"></i>
</span>
input[type="checkbox"]:checked + label .fa-check-circle {
display: block;
background: white;
border-radius: 50%;
color: #37B34A;
height: 28px;
width: 28px;
}
.fa-circle-thin {
color: #DDDDDD;
background-color: #FFFFFF;
border-radius: 50%;
height: 28px;
width: 28px;
text-align:center;
cursor: pointer;
}
Giving a margin-left to .fa-stack .fa-check-circle will do it
.fa-stack .fa-check-circle {
margin-left: 2px;
}
Although I think this is not the best way of doing what you're trying to do there, I think this way should be a better way of doing it: http://jsfiddle.net/7w41fboo/
======== Update =========
If you need to remove the white space of the background of your checked circle, you can do it with this trick. First exchange the fa-check-circle for fa-check like this:
HTML
<div class="faWhiteBg">
<input type="checkbox">
<label>
<span class="fa-stack">
<i class="fa fa-circle-thin fa-stack-2x"></i>
</span>
Unchecked
</label>
</div>
<br />
<input type="checkbox" checked>
<label>
<span class="fa-stack">
<i class="fa fa-check"></i>
</span>
Checked
</label>
Then style your fa-check in your CSS
.fa-stack .fa-check {
background: #37B34A;
color: #fff;
font-size: 22px;
padding: 5px;
border-radius: 50%;
}
.fa-stack {
cursor: pointer;
}
/* The code below is a code to display the white background only for the non checked circle, if you don't want it you can remove this part of the code and remove it from your HTML as well*/
.faWhiteBg .fa-stack {
background: #fff;
border-radius: 50%;
}
Here's an online example