HTML Vertical Line with Buttons in The Middle - html

I am trying to set a vertical line with buttons in the middle with bootstrap.
Using Bootstrap simple vertical line:
<div class="row">
<div class="col-md-6" style="padding-right:20px; border-right: 1px solid #ccc; " >
Area 1
</div>
<div>
Area 2
</div>
</div>
Above only shows a vertical line, but I wanted to be able to add these right in the middle of that vertical line.
<span class="glyphicon glyphicon-arrow-left"></span>
<span class="glyphicon glyphicon-arrow-right"></span>
I couldn't really figure out how to position it using CSS. Is there a good way to go about this?
Any suggestions?
Edit:
I added -
<div class="round" style="position: absolute; top: 40%; right: -13px;">
<span class="glyphicon glyphicon-chevron-right" style="font-size: 1.2em; cursor: pointer;"></span>
</div>
<div class="round" style="position: absolute; top: 55%; right: -14px;">
<span class="glyphicon glyphicon-chevron-left" style="font-size: 1.2em; cursor: pointer;"></span>
</div>
It works, but the vertical line is in between the buttons.. Any suggestions on updating this?

Try this something like this
<div class="row">
<div class="col-md-6">
<div style="padding-right:20px; border-right: 1px solid #ccc; " >Area 1</div>
</div>
<div>
Area 2
</div>

You could use the after selector in css: http://www.w3schools.com/cssref/sel_after.asp
Using it you could do something like:
<div class="row">
<div class="col-md-6 myStyle" style="" >
Area 1
</div>
<div>
Area 2
</div>
</div>
.myStyle {
padding-right:20px; border-right: 1px solid #ccc; }
.myStyle::after{
font-family: 'Glyphicons Halflings';
content: "whatever the icon you want is";
}
You can then use CSS to position the icons however you want.
If you'd like to use more than one Icon you could use the :before selector on the button on the right, and the after on the button on the left.

Related

How to show more information, when user hovers?

I have an info icon which when the user hovers over, is able to see more information. The icons are pngs and I DO NOT want to change the position of the image, so is there any idea about using tooltips with images in my case? I also would like the tooltip to look like this:
Example Tooltip
This is my HTML:
<div class="modeHolder">
<div class="toggle">
<label class="switch">
<input type="checkbox">
<span class="slider round"></span>
</label>
</div>
<div class="mode">
<p>Ipad Mode</p>
</div>
<div class="infoIcon">
<img src="images/info.png" alt="info icon">
</div>
<div class="settings">
<img src="images/settings.png" alt="settings icon">
</div>
</div>
<div class="modeHolder">
<div class="toggle">
<label class="switch">
<input type="checkbox">
<span class="slider round"></span>
</label>
</div>
<div class="mode">
<p>Mac Mode</p>
</div>
<div class="infoIcon">
</div>
<div class="settings"></div>
</div>
</div>
Thank you in advance
Codepen: https://codepen.io/D4SH13/pen/jOmOWqb
1st: Using Title tag in <img> element.
<div class="infoIcon">
<a href="#">
<img title="Extra Info" src="https://cdn.onlinewebfonts.com/svg/img_151567.png" alt="info icon" />
</a>
</div>
Final Code
Code Pen: https://codepen.io/gautam25raj/pen/poPoeNy
2nd: Using <span> element.
Take a <span> element and put it inside your tootltip container.
<div class="infoIcon">
<!-- New span element -->
<span class="extraInfo">Extra Info</span>
</div>
Make the <span> postion: absolute relative to your tooltip container position: relative and add some styles to <span> element.
.infoIcon {
position: relative;
}
.extraInfo {
position: absolute;
color: #fff;
background-color: #000;
border-radius: 5px;
padding: 2px 5px;
width: 70px;
text-align: center;
}
Now, change the visibility of the span element. So that it can stay hidden until the tooltip is hovered.
visibility: hidden;
i.e.
.extraInfo{
position: absolute;
color: #fff;
background-color: #000;
border-radius: 5px;
padding: 2px 5px;
width: 70px;
text-align: center;
visibility: hidden;
}
Now, when your tooltip is hover make the span element visible.
.infoIcon:hover .extraInfo {
visibility: visible;
}
Final Code
Code Pen: https://codepen.io/gautam25raj/pen/xxdxgrO
Hope this solves your problem

Need space between spans and border

<div class="row text-center mt8" >
<span style="border-bottom: 1px solid #e7e7e7;">
<span>Familiarized with the production process</span>
<span></span>
</span>
<div class="small8">
<span>(signature)</span>
</div>
</div>
Hi, I want to make this work. There must be text "Familiarz...." then there should be space, then border and it should be as long as the text is and after that signature. I tried adding spans and brs after text but it's not working.
as a trick you can add a fixer div. after the 'Familiarized...' span add a div class fixer with a little text:
<div class="fixer">fix</div>
and give to him style:
.fixer {
display: inline-block;
visibility: hidden;
padding-bottom: 10px;
}
now you can add a padding-bottom:10px to a span and it will work fine.
the whole code is:
<div class="row text-center mt8">
<span style="border-bottom: 1px solid #e7e7e7; padding-bottom: 10px;">Familiarized with the production process</span>
<div class="fixer" style="display: inline-block;visibility:hidden;padding-bottom: 10px;">fix</div>
<div class="small8">
<span>(signature)</span>
</div>
</div>

Any ideas about how to style this DIV?

I have this , and i want to move the total reviews(The ones that show how many reviews are with how many stars)
Here's how it looks https://i.gyazo.com/a766d0a8804da7ed34d4b295976414b5.png
The mark up is like
<div style="border-top: 1px solid #ddd; padding-top: 20px; vertical-align:top">
<div id="reviews-summary">
<p class="lead" style="margin-top: 0px;">{if $reviews}
<span id="product-stats">
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" style="width:{$review_stats.avg_rating*20}%">
<span class="total-reviews"></span></div></div>
</span>
</div>
<span class="average-rating">{$review_stats.avg_rating}</span>
<span class="total-reviews"> ({$review_stats.total} review{if $review_stats.total > 1}s{/if})</span>
I could've made first div inline block and give it a width of 50% but the line won't go across the whole div anymore. Any ideea is welcome.

To make whole div clickable?

I have a template of handlebars in which there are multiple div which i need to make clickable.
However, in my div the text is dynamic, how will i be able to make whole div clickable. Here is the code
<div class="row">
{{#each event}} {{#is this.event ../eventName }}
<div class="col s12 m3 13 al">
<div class="card ">
<div class="card-image">
<img src="/Small/{{this.imageId}}.JPG">
<span class="imageClick"></span>
</div>
<div class="card-action sp1">
<div class="action-time">
<a href="/{{this.imageId}}/love" class="like sp">
<i class="material-icons fav">favorite</i>
</a>
<span id="{{this.imageId}}" class="like-text">{{this.love}}</span>
</div>
<div class="action-time">
<a href="/{{this.imageId}}/laugh" class="haha sp">
<i class="material-icons laugh">sentiment_very_satisfied</i>
</a>
<span id="{{this.imageId}}laugh" class="haha-text">{{this.laugh}}</span>
</div>
<div class="action-time">
<a href="/{{this.imageId}}/sad" class="downvote sp">
<i class="material-icons down">trending_down</i>
</a>
<span id="{{this.imageId}}sad" class="downvote-text">{{this.sad}}</span>
</div>
{{!-- {{this.imageId}} --}}
</div>
<div class="card-action">
<a class="waves-effect waves-light btn share">button</a>
</div>
</div>
</div>
{{/is}} {{/each}}
I want to make my div action-time clickable with the link in the a tag. I tried to use the popular <span> solution like this but no use. It works for the last action-time making first two not working. How can i solve this.
Css code for action-time and card is:
.action-time{
display: inline-block;
border: 1px solid rgba(202, 202, 202, 0.733);
width: 32%;
padding-top:2px;
padding-left: 4px;
border-radius:8px;
}
and for card :
.card {
margin: 10px;
padding: 5px;
border-radius: 8px;
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
}
.card-action {
padding: 5px 0px !important;
/* padding-right: 5px !important; */
}
Here is what my webpage looks like, I have multiple of those cards
I want to make the whole area in border of heart clickable, rather than just the image to heart.
You can update your html so that the <span> is inside your <a>.
<a href="/{{this.imageId}}/laugh" class="haha sp">
<i class="material-icons laugh">sentiment_very_satisfied</i>
<span id="{{this.imageId}}laugh" class="haha-text">{{this.laugh}}</span>
</a>
Displaying your <a> as a block element will have it fill up the entire <div>. Then you can float your <span> to the right and style it accordingly until it's where you want it exactly.
.action-time a {
display: block;
}
.action-time span {
float: right;
}
You can write some javascript to handle the operation
$(" .action-time").click(function() {
window.location = $(this).find("a").attr("href");
return false;
});
Looks for a link inside div with class of "action-time". Redirects to that links value when anywhere in div is clicked.

Make menu items align the same when adding border on hover

This is my code and I want the alignment to be the same
When I insert a border-left my text goes a bit to the right side but I want all the text to align in the same way.
When I hover it also there the same case.
If I remove the border-left then the text alignment is fine, but how do i get the same alignment when there is border?
<div class="set-leftcol">
<div class="leftcol-box">
<div class="leftcol active">
<div class="sett-i"><i class="fa fa-cog "></i></div>
<div class="sett-title">General</div>
</div>
<div class="leftcol">
<div class="sett-i"><i class="fa fa-key"></i></div>
<div class="sett-title">Security</div>
</div>
</div>
<div class="leftcol-box">
<div class="leftcol">
<div class="sett-i"><i class="fa fa-lock"></i></div>
<div class="sett-title">Privacy</div>
</div>
<div class="leftcol">
<div class="sett-i"><i class="fa fa-cog"></i></div>
<div class="sett-title">Timeline</div>
</div>
<div class="leftcol">
<div class="sett-i"></div>
<div class="sett-title">Blocking</div>
</div>
</div>
<div class="leftcol-box">
<div class="leftcol">
<div class="sett-i"><i class="fa fa-bell"></i></div>
<div class="sett-title">Notification</div>
</div>
<div class="leftcol">
<div class="sett-i"><i class="fa fa-mobile"></i></div>
<div class="sett-title">Mobile</div>
</div>
<div class="leftcol">
<div class="sett-i"><i class="fa fa-rss-square"></i></div>
<div class="sett-title">Followers</div>
</div>
</div>
</div>
http://codepen.io/anon/pen/NqGRqG
change your .leftcol to this :
.leftcol {
float: left;
clear: both;
width: 250px;
cursor: pointer;
background-color: #EBF9FF;
border-left: 4px solid transparent;
}
codepen
The wrong alignment is caused by the :hover state adding a 4px border, so the element is a bit wider when hovered.
One way to prevent that is to add a transparent border to the .leftcol elements, so that when they are hovered only the border color changes but not the width:
.leftcol {
border: 4px solid transparent;
}
Another option would be to use 4px padding on it, and remove that on hover. This is essentially the same trick as above, but uses a padding placeholder for non-hovered elements:
.leftcol {
padding-left: 4px;
}
.leftcol:hover {
padding-left: 0;
}
I don't know if you have intentionally complicated the markup to this extent because you need to do something further with the empty <div>s or have done so accidentally.
In case you didn't have a better way to figure it out, I suggest you take a look at my pen below:
Codepen link to simplify the above markup
I have stripped down your markup to the minimal level and yet achieved the same result you were expecting. Hope it helps you out. Cheers!