How to fix responsive error - html

The problem is that when I resize the window to small size (mobile) it looks fine, but when i revert it to large the canvas extends outside its parent column.
Fiddle
I am using bootstrap 3.3.
But i have to tell that,no problem with other boxes, it doesn't go out of boxes expect this graph
.ibox-title {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #ffffff;
border-color: #e7eaec;
border-image: none;
border-style: solid solid none;
border-width: 4px 0px 0;
color: inherit;
margin-bottom: 0;
padding: 14px 15px 7px;
height: 48px;
border-top-left-radius: 9px;
border-top-right-radius: 9px;
}
.ibox-content {
background-color: #ffffff;
color: inherit;
padding: 15px 20px 20px 20px;
border-color: #e7eaec;
border-image: none;
border-style: solid solid none;
border-width: 1px 0px;
border-bottom-left-radius: 9px;
border-bottom-right-radius: 9px;
}
canvas {
background: pink;
}
<div class="row">
<div class="col-lg-6">
<div class="ibox float-e-margins">
<div class="ibox-content" style="border-radius: 10px;">
<div>
<h3 class="font-bold no-margins">
Statistics Graph
</h3>
</div>
<div class="m-t-sm">
<div class="row">
<div class="col-md-12">
<div>
<canvas id="lineChart" height="114"></canvas>
</div>
</div>
</div>
</div>
<div class="m-t-md">
<small class="pull-right">
<i class="fa fa-clock-o"> </i>
Update on 16.07.2015
</small>
<small>
<strong>Analysis of sales:</strong> The value has been changed over time,sdasdas as been changed over time,sdasdas
</small>
</div>
</div>
</div>
</div>

You probably have set only #media for mobile, so when u resize back to "normal" view it doesn't find a #media for normal view and no rules is overriden.
You should do something like this:
div.try {width:400px;border:1px solid #000;height:300px;}
#media (max-width:400px) {
div.try {width:150px;}
}
#media (min-width:401px) {
div.try {width:400px;}
}
<div class="try"></div>

Canvas is not being resized dinamically so you can try with:
canvas {
width: 100%;
height: auto;
}
canvas {
width: 100%;
height: auto;
}
.ibox-title {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #ffffff;
border-color: #e7eaec;
border-image: none;
border-style: solid solid none;
border-width: 4px 0px 0;
color: inherit;
margin-bottom: 0;
padding: 14px 15px 7px;
height: 48px;
border-top-left-radius: 9px;
border-top-right-radius: 9px;
}
.ibox-content {
background-color: #ffffff;
color: inherit;
padding: 15px 20px 20px 20px;
border-color: #e7eaec;
border-image: none;
border-style: solid solid none;
border-width: 1px 0px;
border-bottom-left-radius: 9px;
border-bottom-right-radius: 9px;
}
<div class="row">
<div class="col-lg-6">
<div class="ibox float-e-margins">
<div class="ibox-content" style="border-radius: 10px;">
<div>
<h3 class="font-bold no-margins">
Statistics Graph
</h3>
</div>
<div class="m-t-sm">
<div class="row">
<div class="col-md-12">
<div>
<canvas class="img-responsive" id="lineChart" height="114"></canvas>
</div>
</div>
</div>
</div>
<div class="m-t-md"> <small class="pull-right">
<i class="fa fa-clock-o"> </i>
Update on 16.07.2015
</small>
<small>
<strong>Analysis of sales:</strong> The value has been changed over time,sdasdas as been changed over time,sdasdas
</small>
</div>
</div>
</div>
</div>

Actually, issue is this when the page is loaded the graph is being created with particular height and width but there is no such option when you resize the window. SO, we have to call redraw() or draw() on $(window).resize() function.
Note: Draw() and redraw() function depends on chart library you are using. First, check which function is to recreate the chart then call it.
But, most of the chart library have redraw function.
I can tell you more if mention the jquery plugin name for the charts.

Related

Anchor tag isn't displaying and is greyed out in in dev tools

I have been fighting with this section of code for a good few hours and cant figure out why it's greyed out in the browser and in dev tools. its suppose to display a title of the listed item. So far Im not seeing any Title unless I remove the class="ad-box-title" from the tag.
CSS
/*Ad box*/
.modern-img-indicator{
position: absolute;
top: 0;
left: 0;
background: rgba(0,0,0, 0.2);
font-size: 11px;
padding: 5px;
color: #ffffff;
}
.ad-box {
background: #fff none repeat scroll 0 0;
border-radius: 4px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
position: relative;
margin-bottom: 20px;
}
.ad-box .ads-thumbnail {
display: block;
overflow: hidden;
position: relative;
border-radius: 3px 3px 0 0;
height: 158px;
}
.ad-box .caption {
background: #fff none repeat scroll 0 0;
padding: 7px 10px;
}
.ad-box-caption-title {
height: 32px;
margin-bottom: 5px;
overflow: hidden;
}
.ad-box-caption-title .ad-box-title {
color: #666666;
}
.ad-box-category {
font-size: 11px;
height: 30px;
border-top: 1px solid #e7e7e7;
line-height: 30px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ad-box-footer {
background-color: #f6f6f6;
border-radius: 0 0 3px 3px;
border-top: 1px solid #e7e7e7;
box-shadow: 0 1px 0 0 #fff inset;
padding: 5px 8px;
position: relative;
}
span .ad-box-footer, .ad-box-price {
display: block;
}
.ad-box-price {
font-size: 12px;
}
.ad-box-premium i {
margin-top: 7px;
color: #f21aa5;
}
.ad-box-premium {
border-left: 1px solid #ddd;
color: #aaa;
cursor: default;
height: 28px;
position: absolute;
right: 1px;
text-align: center;
top: 1px;
transition: color 0.15s linear 0s;
width: 29px;
}
.ad-box-premium img {
max-height: 25px;
width: auto;
}
.countdown{
padding: 5px;
font-size: 14px;
text-align: center;
}
.place-bid-btn{
text-align: center;
}
HTML
<div class="col-md-3">
<div class="ad-box">
<!-- Thumbnail -->
<div class="ads-thumbnail">
<a href="#">
<img src="/uploads/thumbs/cat.jpg" alt="Auction title" class="img-fluid">
<span class="modern-img-indicator">
<i class="far fa-file-image"></i>
</span>
</a>
</div>
<!-- Caption -->
<div class="caption">
<div class="ad-box-caption-title">
<a href="#" class="ad-box-title">
Title Here
</a>
</div>
<div class="ad-box-category">
<a href="#" class="price text-muted">
<i class="far fa-folder"></i> Category Name Here
</a>
<a href="#" class="price text-muted">
<i class="fas fa-map-marker-alt"></i> Location Here
</a>
</div>
</div>
<!-- Box footer -->
<div class="ad-box-footer">
<span class="ad-box-price">Starting price here $0.00</span>
<span class="ad-box-price">Current Bid here $0.00</span>
<!-- If its a premium auction -->
<div class="ad-box-premium">
<img src="/images/premium-icon.png" alt="Premium Auction Image here">
</div>
<!-- Countdown -->
<div class="countdown">Time remaining</div>
<div class="place-bid-btn">
Place Bid
</div>
</div>
</div>
</div>

Edit Spaces Between Elements

I have a pill / tab navigation menu, and I need to connect the menu to the rest of the body and the underline of the divs in order to make the menu look nice.
I need to color the space between the black and yellow and connect the underlined divs
.tab {
display: inline-block;
text-align: center;
border-bottom: 1px solid white;
width: 75px;
}
.selected {
border: 1px solid white;
border-bottom: none;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
background-color: rgba(0,0,0,1);
}
.createScreen {
display: block;
background-color: yellow;
width: 985px;
height: 500px;
}
.personalContainer {
margin-left: 5px;
}
.personalContainer, .shippingContainer, .billingContainer, .cardContainer {
margin-top: 5px;
display: inline-block;
background-color: rgba(0,0,0,0.25);
height: 400px;
width: 240px;
}
<div class="billingNav">
<div id="#createTab" class="tab selected">Create</div>
<div id="#editTab" class="tab notSelected">Edit</div>
<div id="#deleteTab" class="tab notSelected">Delete</div>
</div>
<div class="createScreen show">
<div class="personalContainer">
</div>
<div class="shippingContainer">
</div>
<div class="billingContainer">
</div>
<div class="cardContainer">
</div>
</div>
<div class="editScreen">
</div>
<div class="deleteScreen">
</div>
If you meant to the small gap between your selected tab and the menu, you can't make its border-bottom: none;.
Instead, I suggest you just override the tab preferences, so the bottom-border of the selected tab is black:
.selected {
border: 1px solid white;
border-bottom: 1px solid black;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
background-color: rgba(0,0,0,1);
}
This might get you closer to the result you need , before replacing these codes pls remove .selected from css.
.billingNav {
padding: 5px;
background-color: #444;
}
.tab {
display: inline-block;
margin-bottom: 5px;
text-align: center;
width: 75px;
color: #fff;
}
.tab:hover {
border-bottom: 2px solid #fff;
}
To connect the tabs together (no gap between tabs) you can see this question. there are several methods like as remove the whitespace in the HTML between the inline-block elements (no new line between of prev item and of next item). You may also use negative letter-spacing for parent and reset it to normal on cild (tab) elements.
The small white gap below the menu items are produced by the .tab {... border-bottom: 1px solid white;} style you set for tabs but border-bottom: none; on selected tab. to remove that space simply remove the border-bottom from tab.
Here is a working sample:
.billingNav {letter-spacing: -1em;}
.tab {
display: inline-block;
text-align: center;
letter-spacing: normal;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
width: 75px;
/*border-right: 1px solid white;
background-color: rgba(200,200,200,1);*/
}
.selected {
/*border: 1px solid white;*/
/*border-bottom: none;*/
background-color: rgba(0,0,0,1);
color: white;
}
.createScreen {
display: block;
background-color: yellow;
width: 985px;
height: 500px;
}
.personalContainer {
margin-left: 5px;
}
.personalContainer, .shippingContainer, .billingContainer, .cardContainer {
margin-top: 5px;
display: inline-block;
background-color: rgba(0,0,0,0.25);
height: 400px;
width: 240px;
}
<div class="billingNav">
<div id="#createTab" class="tab selected">Create</div>
<div id="#editTab" class="tab notSelected">Edit</div>
<div id="#deleteTab" class="tab notSelected">Delete</div>
</div>
<div class="createScreen show">
<div class="personalContainer">
</div>
<div class="shippingContainer">
</div>
<div class="billingContainer">
</div>
<div class="cardContainer">
</div>
</div>
<div class="editScreen">
</div>
<div class="deleteScreen">
</div>
Another appearance could be achieved by adding a background and small right border to (non-selected) tabs:
.billingNav {letter-spacing: -1em;}
.tab {
display: inline-block;
text-align: center;
letter-spacing: normal;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
width: 75px;
border-right: 1px solid white;
background-color: rgba(200,200,200,1);
}
.selected {
/*border: 1px solid white;*/
/*border-bottom: none;*/
background-color: rgba(0,0,0,1);
color: white;
}
.createScreen {
display: block;
background-color: yellow;
width: 985px;
height: 500px;
}
.personalContainer {
margin-left: 5px;
}
.personalContainer, .shippingContainer, .billingContainer, .cardContainer {
margin-top: 5px;
display: inline-block;
background-color: rgba(0,0,0,0.25);
height: 400px;
width: 240px;
}
<div class="billingNav">
<div id="#createTab" class="tab selected">Create</div>
<div id="#editTab" class="tab notSelected">Edit</div>
<div id="#deleteTab" class="tab notSelected">Delete</div>
</div>
<div class="createScreen show">
<div class="personalContainer">
</div>
<div class="shippingContainer">
</div>
<div class="billingContainer">
</div>
<div class="cardContainer">
</div>
</div>
<div class="editScreen">
</div>
<div class="deleteScreen">
</div>
Getting rid of the whitespace in between the underlined elements connected their borders
<div id="#createTab" class="tab selected">Create</div><div
id="#editTab" class="tab notSelected">Edit</div><div id="#deleteTab"
class="tab notSelected">Delete</div>
I personally would adjust the vertical-align so that the tabs do not have a gap in-between the values they already have a parent div container so the css would be
.tabSelected {
vertical-align: -4px; // or however many you need so that there is no gap

Put two divs one near the other

I have the following html code:
<div class="demand page">
<div id="crumby-title">
<div class="page-icon">
<i class="fa fa-line-chart"></i>
</div>
<div class="page-title">
Demand
</div>
</div>
<div id="chart" class="demand-chart">
</div>
</div>
and the css/less:
.rtm {
.app__header {
background-color: #ffffff;
box-shadow: 1px 2px 2px rgba(1, 1, 1, 0.15);
}
.app__inner-content {
background-color: #ffffff;
}
.demand-chart{
padding-top: 50px;
}
#crumby-title {
display: block;
border-bottom: 1px solid #eee;
}
.page-icon {
font-size: 20px;
position: absolute;
padding: 14px 18px;
background: #e7e7e7;
}
.page-title {
float: left;
font-size: 20px;
font-weight: 5px 10px 10px 75px;
height: 55px;
}
}
I tried to do like this in order to show the page-icon and page-title one near the other but how it is done now they are one over the other (the icon is on top of the title)
How can I solve this? Thanks
When you say "near each other" I am assuming you mean "beside each other".
You can add flexbox properties to #crumby-title. Then remove position and float properties from .page-icon and page-title. You can also remove height from .page-title
.app__header {
background-color: #ffffff;
box-shadow: 1px 2px 2px rgba(1, 1, 1, 0.15);
}
.app__inner-content {
background-color: #ffffff;
}
.demand-chart {
padding-top: 50px;
}
#crumby-title {
display: flex;
align-items: center;
border-bottom: 1px solid #eee;
}
.page-icon {
font-size: 20px;
padding: 14px 18px;
background: #e7e7e7;
}
.page-title {
font-size: 20px;
font-weight: 5px 10px 10px 75px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<div class="demand page">
<div id="crumby-title">
<div class="page-icon">
<i class="fa fa-line-chart"></i>
</div>
<div class="page-title">
Demand
</div>
</div>
<div id="chart" class="demand-chart">
</div>
</div>
Give float:left to .page-icon instead of position:absolute and add <div class="clear"></div> after page-title.
.app__header {
background-color: #ffffff;
box-shadow: 1px 2px 2px rgba(1, 1, 1, 0.15);
}
.app__inner-content {
background-color: #ffffff;
}
.demand-chart{
padding-top: 50px;
}
#crumby-title {
display: block;
border-bottom: 1px solid #eee;
}
.page-icon {
font-size: 20px;
float: left;
padding: 14px 18px;
background: #e7e7e7;
}
.page-title {
float: left;
font-size: 20px;
font-weight: 5px 10px 10px 75px;
height: 55px;
}
.clear{
clear:both;
}
<div class="demand page">
<div id="crumby-title">
<div class="page-icon">
<i class="fa fa-line-chart"></i>
</div>
<div class="page-title">
Demand
</div>
<div class="clear"></div>
</div>
<div id="chart" class="demand-chart">
</div>
</div>
I want to show u another version of ankita pantel's put them in a table and add padding-top to Demand
.app__header {
background-color: #ffffff;
box-shadow: 1px 2px 2px rgba(1, 1, 1, 0.15);
}
.app__inner-content {
background-color: #ffffff;
}
.demand-chart{
padding-top: 50px;
}
#crumby-title {
display: block;
border-bottom: 1px solid #eee;
}
.page-icon {
font-size: 20px;
padding: 14px 18px;
background: #e7e7e7;
}
.page-title {
padding-top: 30px;
float: left;
font-size: 20px;
font-weight: 5px 10px 10px 75px;
height: 55px;
}
<div class="demand page">
<div id="crumby-title">
<table>
<tr>
<td>
<div class="page-icon">
<i class="fa fa-line-chart"></i>
</div>
</td>
<td>
<div class="page-title">
Demand
</div>
</td>
</tr>
</table>
</div>
<div id="chart" class="demand-chart">
</div>
</div>
All the cool kids are using flex box.
display:flex; flex-direction:row; makes the child items stack in a row. (flex-direction:row is default so you can skip that)
#crumby-title {
...
display: flex;
flex-direction:row;
}
then you can (if you want) center the text with
.page-title {
....
display: flex;
align-items: center;
}
Fiddle

How to put a border-radius on a specific corner of a button

I have a modal that looks like this
As you can see, the modal has border-radius but the buttons at the footer dont. I want to put a border-radius at the bottom left of the purple button and a border-radius at the bottom right of the gray button. Ive tried border-bottom-left-radius and border-bottom-right-radius but it didnt work. Here`s my codes
Modal:
<!--Notifier Modal-->
<div id="notifier-modal" class="modal fade" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="confirm-purchase-label">
Only {{size}} out of {{totalsize}} transactions have been loaded <br>
<h5>The complete list of transactions will be sent to your email after the process.</h5>
</div>
</div>
</div>
</div>
<div class="modal-footer g-nopadding">
<div class="col-md-6 g-nopadding">
<button type="button" class="btn btn-purple btn-block col-md-6" ng-click="proceedAction();">PROCEED</button>
</div>
<div class="col-md-6 g-nopadding">
<button type="button" class="btn btn-gray btn-block col-md-6" data-dismiss="modal">CANCEL</button>
</div>
</div>
</div>
</div>
CSS:
#notifier-modal .btn,
{
border: none!important;
border-radius: 0px!important;
font-family: 'AvenirMedium';
height: 50px!important;
}
#notifier-modal .modal-md{
width: 500px;
}
.modal-footer {
padding: 15px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-content{
background:#f0f0f0;
box-shadow:0px 0px 30px 0px rgba(101,101,101,0.50);
border: none;
}
.btn-gray {
color: #797979!important;
background:#e0e0e0!important;
font-size:14px!important;
border: none!important;
}
.btn-purple {
color: #f0f0f0!important;
background-color: #9c82cd!important;
font-size:14px!important;
border: none!important;
}
.modal-footer{
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
overflow: hidden;
}
overflow: hidden solves it.
You can just apply a border-radius to all side of the modal that already has the top left/right border-radius, and assuming the buttons are at the bottom corners of that element, if you also add overflow: hidden to the modal with the border-radius, it will clip the corners of the buttons.
body {
background: #aaa;
text-align: center;
}
div {
background: #fff;
border-radius: 1em;
padding: 1em;
display: inline-block;
width: 200px;
height: 100px;
position: relative;
overflow: hidden;
}
button {
position: absolute;
bottom: 0;
padding: 0;
margin: 0;
width: 50%;
left: 0;
padding: .5em 0;
background: #09c;
color: white;
border: 0;
}
button:last-child {
left: auto;
right: 0;
border-left: 1px solid white;
}
<div>
<button>button</button>
<button>button</button>
</div>
To put a border-radius at the bottom left of the purple button You can use below CSS
.btn-purple {
color: #f0f0f0!important;
background-color: #9c82cd!important;
font-size: 14px!important;
border: none!important;
border-radius: 0 0 0 20px; /*20px is example you can use how much radius you want*/
}
To put a border-radius at the bottom right of the gray button. You can use below CSS
.btn-gray {
color: #797979!important;
background: #e0e0e0!important;
font-size: 14px!important;
border: none!important;
border-radius: 0 0 20px 0;
}
Add the following CSS to your buttons and adjust for each accordingly
-moz-border-radius-topleft: 0px;
-moz-border-radius-topright:0px;
-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px;
-webkit-border-top-left-radius:0px;
-webkit-border-top-right-radius:0px;
-webkit-border-bottom-left-radius:5px;
-webkit-border-bottom-right-radius:5px;
border-top-left-radius:0px;
border-top-right-radius:0px;
border-bottom-left-radius:5px;
border-bottom-right-radius:5px;
The issue is simply a word-ordering one :)
Instead of border-radius-bottom-left and border-radius-bottom-right, the attributes you're looking for are border-bottom-left-radius and border-bottom-right-radius:
.modal-footer {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
Hope this helps! :)
As discussed you have border radius set to zero important in css
#notifier-modal .btn,
{
border: none!important;
border-radius: 0px!important;
font-family: 'AvenirMedium';
height: 50px!important;
}
Try commenting it out and then adding in the bottom ones.
There are many resources online but the best one i have found is
Border radius
it lets you set border radius seperatly or all at once. It also give you the CSS to use.
Cheers

Bootstrap Panel Headings

I am trying to remove the border that creates the panels Body but having some issues finding it.
Here is the code for my panel:
<div class="panel">
<div class="panel-heading"> <span class="panel-title"><i class="icon-user"></i> Training Team</span><button type="button" name="addProjectMember" class="btn btn-mini pull-right"><i class="icon-plus"></i> Add Project Member</button></div>
<div name="trainingTeamBody" style="display:none;" class="panel-body">
<span name="teamError"><br><div class="alert alert-warning"><center>No Project Members Assigned</center></div></span>
<table name="teamTable" class="table table-hover" style="display: none;">
<thead>
<tr>
<th><small>Member</small></th>
<th><small>Role</small></th>
<th><small>Supervisor</small></th>
<th><small>Date Assigned</small></th>
<th><small>Who Assigned</small></th>
<th><small>Action</small></th>
</tr>
</thead>
<tbody name="teamTableResults"></tbody>
</table>
</div>
</div>
In the image above, All I would like its the gray bar which would be what I'd consider to be the heading. If there are no results to show, I simply want the bar to appear without the outline of the body.
As a test, I removed the body completely from the code but the border was still there.
Is there a part of the panels CSS that is causing this that I can overwrite?
This is for Panels in Bootstrap 2 which I did by using the following CSS:
panel {
padding: 15px;
margin-bottom: 20px;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.panel-heading {
padding: 10px 15px;
margin: -15px -15px 15px;
font-size: 17.5px;
font-weight: 500;
background-color: #f5f5f5;
border-bottom: 1px solid #dddddd;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.panel-footer {
padding: 10px 15px;
margin: 15px -15px -15px;
background-color: #f5f5f5;
border-top: 1px solid #dddddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel-primary {
border-color: #428bca;
}
.panel-primary .panel-heading {
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
}
Here you go - http://jsfiddle.net/AndrewL32/9ema30gx/2/
.panel {
border: 0 !important;
}
Hope that helps :)