I am trying to create a custom checklist box box using bootstrap and font-awesome icons. Here is what I done and the output:
http://jsfiddle.net/9nuhnbbv/110/
<style>
.bigmodal {
height: 90%;
left: 5%;
margin: 0;
width: 90%;
}
.bigmodal.fade.in {
top: 5%;
}
.bigmodal .modal-body {
max-height: none;
}
.bigmodal .modal-content {
width: 100%;
}
</style>
<a data-toggle="modal" href="#HoastedModal" class="btn btn-info">Hoasted Modal</a>
<br>
<br>
<div id="HoastedModal" class="modal fade">
<div class="modal-dialog bigmodal">
<div class="modal-content">
<div class="modal-header">
<h4 id="modal-label">Header</h4>
</div>
<div class="modal-body">
<div class="modal-body" id="poiModalBody">
<div class="row" id="tree-container">
<div class="col-md-4">
<fieldset>
<legend>Groups</legend>
<div class="list-group poi-list">
<div id="groups-container">
<a class="list-group-item" data-id="37" href="#" style="display: block;"> <span>ACCOMMODATION, EATING AND DRINKING</span> </a>
<a class="list-group-item" data-id="38" href="#" style="display: block;"> <span>COMMERCIAL SERVICES</span> </a>
<a class="list-group-item" data-id="39" href="#" style="display: block;"> <span>ATTRACTIONS</span> </a>
<a class="list-group-item" data-id="40" href="#" style="display: block;"> <span>SPORT AND ENTERTAINMENT</span> </a>
<a class="list-group-item" data-id="41" href="#" style="display: block;"> <span>EDUCATION AND HEALTH</span> </a>
<a class="list-group-item" data-id="42" href="#" style="display: block;"> <span>PUBLIC INFRASTRUCTURE</span> </a>
<a class="list-group-item" data-id="43" href="#" style="display: block;"> <span>MANUFACTURING AND PRODUCTION</span> </a>
<a class="list-group-item" data-id="44" href="#" style="display: block;"> <span>RETAIL</span> </a>
<a class="list-group-item" data-id="45" href="#" style="display: block;"> <span>TRANSPORT</span> </a>
</div>
</div>
</fieldset>
</div>
<div class="col-md-4">
<fieldset>
<legend>Categories</legend>
<div class="list-group poi-list">
<div id="categories-container">
<a class="list-group-item poi-category" href="#" style="display: block;"> <span>AIR</span> <i data-id="255" class="fa fa-square-o fa-2x pull-right category-selectall"></i> </a>
<a class="list-group-item poi-category" href="#" style="display: block;">
<span>ROAD AND RAIL</span> <i data-id="256" class="fa fa-square-o fa-2x pull-right category-selectall"></i> </a>
<a class="list-group-item poi-category" href="#" style="display: block;">
<span>WALKING</span> <i data-id="257" class="fa fa-square-o fa-2x pull-right category-selectall"></i> </a>
<a class="list-group-item poi-category" href="#" style="display: block;">
<span>WATER</span> <i data-id="258" class="fa fa-square-o fa-2x pull-right category-selectall"></i> </a>
<a class="list-group-item poi-category" href="#" style="display: block;">
<span>PUBLIC TRANSPORT, STATIONS AND INFRASTRUCTURE</span> <i data-id="259" class="fa fa-square-o fa-2x pull-right category-selectall"></i> </a>
<a class="list-group-item poi-category"
href="#" style="display: block;"> <span>BUS TRANSPORT</span> <i data-id="260" class="fa fa-square-o fa-2x pull-right category-selectall"></i> </a>
</div>
</div>
</fieldset>
</div>
<div class="col-md-4">
<fieldset>
<legend>Classes</legend>
<div class="list-group poi-list">
<div id="classes-container">
<i class="fa fa-hand-o-left"></i> Please select a cateogy.
</div>
</div>
</fieldset>
</div>
<div class="clearfix"></div>
</div>
<hr>
<div class="row" id="calculation-section">
<div class="pull-left" id="poi-calculate-quote-container">
<button type="button" id="poi-calculate-price-button" class="btn btn-primary">Calculate Price</button>
<button type="button" data-toggle="tooltip" data-placement="top" title="Tooltip on top" id="poi-reset-button" class="btn btn-primary">
Reset Selection
</button>
<button type="button" id="poi-addto-basket-button" class="btn btn-success hide">Add To Basket</button>
</div>
<div class="pull-right">
<button id="poi-tree-close-dialogue-button" class="btn">Close</button>
</div>
</div>
<hr>
<div id="quote-section">
<div style="display: none" id="poi-quote-progressbar" class="progress progress-striped active">
<div style="width: 100%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="40" role="progressbar" class="progress-bar progress-bar-primary">
<span class="sr-only">Please wait</span>
</div>
</div>
<div id="poi-quote-result">
</div>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>
<!--modal-content-->
</div>
<!--modal-dialog-->
</div>
<!--modal-->
It work's fine in most of the resolutions but in some resolutions it has alignment issue as it shown in the below image:
This screenshot has taken from a screen with 1613px.
But if I make the screen slightly smaller or bigger the alignment issue gets fixed:
Since your 'checkboxes' don't scale, you could add more padding to the list items and let the icons sit in the padding so that the text to the left doesn't interfere at any breakpoint:
.list-group-item {
padding-right: 40px;
}
.list-group-item i {
position: absolute;
right: 15px;
}
Related
I have a website that displays several articles on a page. Here is the code for one of them.
<article class="post post-large ">
<div title="Contest start date" class="post-date">
<span class="day">14</span>
<span class="month">Jul</span>
</div>
<div class="post-content">
<h2 class="font-weight-semibold text-6 line-height-3"><a class="contest_title" target="_blank" href="go/123456">TITLE <i class="fas fa-external-link-alt"></i></a></h2>
<h4 class="mb-1 text-4 font-weight-bold">Ends in <span class="text-color-secondary">7 Days 8 Hours</span></h4>
<div class="scrollable visible-slider colored-slider has-scrollbar" data-plugin-scrollable="" style="max-height: 15em; height: 52px;">
<div class="scrollable-content" tabindex="0" style="right: -17px;">
DESCRIPTION
</div>
<div class="scrollable-pane" style="opacity: 1; visibility: visible; display: none;"><div class="scrollable-slider" style="height: 39px; transform: translate(0px, 0px);"></div></div></div>
<div class="post-meta">
<span title="Platform: Gleam"><img src="img/platforms/gleam.png"> </span>
<span title="Author"><i class="far fa-user"></i> By SweepsDB </span>
<span><i title="Contest has referral option" class="fas fa-share-alt-square fa-lg text-primary"></i></span>
<span title="End Date"><i class="far fa-calendar-alt"></i> July 21, 2022 </span>
<span title="Countries"><i class="fas fa-globe-americas"></i> Canada</span>
<span title="Report contest"><i class="far fa-flag"></i> <a data-id="123456" data-bs-toggle="modal" data-bs-target="#reportModal" class="report" href="#">Report</a></span>
<span style="float: right;" class="d-block d-sm-inline-block float-sm-right mt-3 mt-sm-0"><a target="_blank" href="go/123456" class="btn btn-xs btn-light text-1 text-uppercase">Visit Contest</a></span>
<span style="float: right;" class="d-block d-sm-inline-block float-sm-right mt-3 mt-sm-0">More Details</span>
</div>
</div>
</article>
which looks something like this:
However sometimes on mobile layouts, the More Details and Visit Contest links are below the bottom border, like this:
The relevant CSS for border-bottom is:
article {
border-bottom: 2px solid rgba(0, 0, 0, 0.075);
margin-bottom: 20px;
padding-bottom: 8px;
}
What do I need to change to have the bottom border show up at the true bottom of the <article>, even if there is overflow from other elements within the article?
I'm want to select the words "Dashboard", "Attendance", "Marcum" and "Results" and set their color to White.
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="fpstartwrap">
<div class="fpstart">
<div class="iconset">
<div class="btn btn-secondary">
<a role="button" href="https://rafiee.net" title="Dashboard"
alt="Dashboard" target="_blank">
<div class="navicon" align="center">
<i class="fa fa-3x fa-home"></i>
</div>
Dashboard
</a>
</div>
<div class="btn btn-secondary">
<a role="button" href="https://rafiee.net/attendance"
title="Attendance" alt="Attendance" target="_blank">
<div class="navicon" align="center">
<i class="fa fa-3x fa-user-times"></i>
</div>
Attendance
</a>
</div>
<div class="btn btn-secondary">
<a role="button" href="https://rafiee.net/q" title="Marcum"
alt="Marcum" target="_parent">
<div class="navicon" align="center">
<i class="fa fa-3x fa-calculator"></i>
</div>
Marcum
</a>
</div>
<div class="btn btn-secondary">
<a role="button" href="https://rafiee.net/user/" title="Results"
alt="Results" target="_self">
<div class="navicon" align="center">
<i class="fa fa-3x fa-id-card-o"></i>
</div>
Results
</a>
</div>
</div>
</div>
</div>
<div class="collapse" id="fpslider">
<div class="row">
<div class="col-md-3">
<a class="btn btn-primary" href="https://rafiee.net">Rafiee.net</a>
</div>
<div class="col-md-3">
<a class="btn btn-primary" href="https://rafiee.net/attendance">Attendance</a>
</div>
<div class="col-md-3">
<a class="btn btn-primary" href="https://rafiee.net/dailybonus">Daily Bonus</a>
</div>
<div class="col-md-3">
<a class="btn btn-primary" href="https://rafiee.net/q">Marcum Calculator</a>
</div>
</div>
</div>
<div style="clear:both;"></div>
</div>
</div>
</div>
I tried to do it by :
div a[role="button"] {
color: white;
}
However, since I have other elements with role "Button", they are all changed to white which is undesirable in my case. I only need to target these four words. Is it possible? Any help is appreciated in advance.
Thanks
Use the parent elements in the selector to be more specific:
.fpstartwrap > .fpstart > .iconset > div.btn.btn-secondary a[role="button"] {
color: white;
}
Or simply apply a class to those buttons which you only use for these four buttons and use that class in your selector.
To get a CSS selector to only act on a button inside a div use > this tells CSS to get all elements that have a parent div and role=button:
div > a[role="button"] {
color: white;
}
if you really need to be specific then you can even just add a special class to the buttons you wanna act on like
<a class="whiteButton" role="button" href="https://rafiee.net/attendance" title="Attendance" alt="Attendance" target="_blank">
Then for the CSS you can do
.whiteButton {
}
or if only whiteButton inside of div's
div > .whiteButton {
}
or even
div > a > .whiteButton {
}
div > a[role="button"]{
color: white;
background: blue;
}
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="fpstartwrap">
<div class="fpstart">
<div class="iconset">
<div class="btn btn-secondary">
<a role="button" href="https://rafiee.net" title="Dashboard"
alt="Dashboard" target="_blank">
<div class="navicon" align="center">
<i class="fa fa-3x fa-home"></i>
</div>
Dashboard
</a>
</div>
<div class="btn btn-secondary">
<a role="button" href="https://rafiee.net/attendance"
title="Attendance" alt="Attendance" target="_blank">
<div class="navicon" align="center">
<i class="fa fa-3x fa-user-times"></i>
</div>
Attendance
</a>
</div>
<div class="btn btn-secondary">
<a role="button" href="https://rafiee.net/q" title="Marcum"
alt="Marcum" target="_parent">
<div class="navicon" align="center">
<i class="fa fa-3x fa-calculator"></i>
</div>
Marcum
</a>
</div>
<div class="btn btn-secondary">
<a role="button" href="https://rafiee.net/user/" title="Results"
alt="Results" target="_self">
<div class="navicon" align="center">
<i class="fa fa-3x fa-id-card-o"></i>
</div>
Results
</a>
</div>
</div>
</div>
</div>
<div class="collapse" id="fpslider">
<div class="row">
<div class="col-md-3">
<a class="btn btn-primary" href="https://rafiee.net">Rafiee.net</a>
</div>
<div class="col-md-3">
<a class="btn btn-primary" href="https://rafiee.net/attendance">Attendance</a>
</div>
<div class="col-md-3">
<a class="btn btn-primary" href="https://rafiee.net/dailybonus">Daily Bonus</a>
</div>
<div class="col-md-3">
<a class="btn btn-primary" href="https://rafiee.net/q">Marcum Calculator</a>
</div>
</div>
</div>
<div style="clear:both;"></div>
</div>
</div>
</div>
I need some advice to make bootstrap panel header responsive. Panel has title with several buttons on the right side. It looks fine in large screen but looks ugly when browser size is small.
My full code here jsfiddle.
.panel {
margin: 15px;
}
.panel-title {
padding-top: 7px;
font-size: 20px;
}
.mr-10 {
margin-right: 10px;
}
<div class="panel panel-success panel-br-4">
<div class="panel-heading clearfix">
<h4 class="panel-title pull-left">
<i class="fa fa-file-text" aria-hidden="true"></i> <span>Documents</span>
</h4>
<a id="document-сreate-btn" class="btn btn-success pull-right">
<i class="fa fa-plus-circle"></i>
<span>Create new document</span>
</a>
<a class="btn btn-warning pull-right mr-10">
<i class="fa fa-chevron-circle-down" aria-hidden="true"></i>
</a>
<a class="btn btn-warning pull-right mr-10">
<span>Save new order</span>
</a>
</div>
<div class="panel-body">Some content</div>
</div>
When all items cannot fit in one line, I want to make header as in the next picture:
Is such things makes by flexbox or bootstrap grid system? Whats the better way? I will appreciate any examples! :)
This is just a quick example of how to use Bootstrap grid system. It's not gonna be as perfect as you want but it will give you an introduction to grid systems. Also, don't forget to read about media queries.
<div class="panel panel-success panel-br-4">
<div class="panel-heading">
<div class="row">
<div class="col-sm-6">
<h4 class="panel-title">
<i class="fa fa-file-text" aria-hidden="true"></i>
<span>Documents</span>
</h4>
</div>
<div class="col-sm-3" style="display: flex">
<a class="btn btn-warning mr-10">
<span>Save new order</span>
</a>
<a class="btn btn-warning">
<i class="fa fa-chevron-circle-down" aria-hidden="true"></i>
</a>
</div>
<div class="col-sm-3">
<a id="document-сreate-btn" class="btn btn-success mr-10" data-url="">
<i class="fa fa-plus-circle"></i>
<span>Create new document</span>
</a>
</div>
</div>
</div>
<div class="panel-body">Some content</div>
I'm using bootstrap for an easy responsive design. However, I moved computer today and was going to work on my project some more and my design is acting up (See attached figures). I have tested to see if I changed width, would it act up; no it did not. I then played with the height of my browsers to see if it did and yes it did act up and displayed improperly. I am fairly new-ish to bootstrap, but I am not sure what is causing this or could be on something on my computer end. I used Chrome for both viewing. I also tested with Edge and it displayed properly.
Look top-right for view port
This is what it should look like
This is what I get when changing resolution
At request, another part of the code which is loaded via JS.
<body>
<div id="interfaceNaviation" style="position:relative;top:0;left:0;right:0;background-color:green;">
<div class="navBar"><span class="navLink">Home</span> <span class="navLink">Presentation</span> <span class="navLink">Schedules</span> <span class="navLink">Display</span></div>
<br>
<div id="loginInfo">
<button id="signinButton" type="button" class="btn btn-primary btn-fixed-width navbar-btn" style="visibility: visible; display: inline;">
Sign in <i class="fa fa-white fa-sign-in icon-right"></i>
</button>
<a href="javascript:void(0);" id="signoutButton" class="navbar-nav" style="visibility: hidden; display: none;">
<span>Sign Out</span>
<i class="fa fa-blue-custom fa-sign-out"></i>
</a>
<div style="display:inline;" id="signinText">Authorize requests using OAuth 2.0:</div>
</div>
</div>
<div id="pres_interface" class="container-fluid" style="height:90%;">
<div id="pres_options" class="row" style="height:5%;">
<div id="add-placeholder" class="col-xs-2"><button id="btn_add-placeholder" class="btn btn-success fa-1.2x">Add Placeholder</button></div>
</div>
<!--style="left:0px;width:20%;height:100%;position:relative;"-->
<div id="pres_editor_panel" class="row" style="height:95%">
<div class="col-xs-2">
<div id="editor_display">
<div id="placeholderContainer"><span class="header fa-1.2x">Placeholders</span></div>
<li><span name="placeholders-change" class="fa-1.2x" data-id="ph1">ph1 <i data-id="void" class="fa fa-trash-o"></i></span></li>
<li><span name="placeholders-change" class="fa-1.2x" data-id="ph2">ph2 <i data-id="void" class="fa fa-trash-o"></i></span></li>
<li><span name="placeholders-change" class="fa-1.2x" data-id="ph04">ph04 <i data-id="void" class="fa fa-trash-o"></i></span></li>
<li><span name="placeholders-change" class="fa-1.2x" data-id="Test">Test <i data-id="void" class="fa fa-trash-o"></i></span></li>
<li><span name="placeholders-change" class="fa-1.2x" data-id="Test1">Test1 <i data-id="void" class="fa fa-trash-o"></i></span></li>
</div>
</div>
<!-- style="width:79.9%;height:100%" -->
<div class="col-xs-10 fa-padless-left">
<iframe id="fake_view" src="fake_view.html" style="width:100%;height:100%;border:1px solid #081D79;"></iframe>
</div>
</div>
</div>
<div id="pres_options-lower" style="background-color:purple;left:0;right:0;text-align:right;bottom:0;">
<button>Restore</button>
<button>Save</button>
<button>Publish</button>
</div>
<div id="window_mask" class="mask hidden"></div>
<div id="popup_display" class="hidden"></div>
<div id="sub_popup_display" class="hidden"></div>
<div id="sub_window_mask" class="mask hidden"></div>
</body>
This is my body code WITHOUT being edited via JS:
<body>
<div id="interfaceNaviation" style="position:relative;top:0;left:0;right:0;background-color:green;">
<div class="navBar"><span class="navLink">Home</span> <span class="navLink">Presentation</span> <span class="navLink">Schedules</span> <span class="navLink">Display</span></div>
<br /><div id="loginInfo">
<button id="signinButton" type="button" class="btn btn-primary btn-fixed-width navbar-btn">
Sign in <i class="fa fa-white fa-sign-in icon-right"></i>
</button>
<a href="javascript:void(0);" id="signoutButton" class="navbar-nav">
<span>Sign Out</span>
<i class="fa fa-blue-custom fa-sign-out"></i>
</a>
<div style="display:inline;" id="signinText"></div>
</div>
</div>
<div id="pres_interface" class="container-fluid" style="height:90%;" >
<div id="pres_options" class="row" style="height:5%;">
<div id="add-placeholder" class="col-xs-2"><button id="btn_add-placeholder" class="btn btn-success fa-1.2x">Add Placeholder</button></div>
</div>
<!--style="left:0px;width:20%;height:100%;position:relative;"-->
<div id="pres_editor_panel" class="row" style="height:95%">
<div class="col-xs-2">
<div id="editor_display" >
</div>
</div>
<!-- style="width:79.9%;height:100%" -->
<div class="col-xs-10 fa-padless-left">
<iframe id="fake_view" src="fake_view.html" style="width:100%;height:100%;border:1px solid #081D79;" ></iframe>
</div>
</div>
</div>
<div id="pres_options-lower" style="background-color:purple;left:0;right:0;text-align:right;bottom:0;">
<button>Restore</button>
<button>Save</button>
<button>Publish</button>
</div>
<div id="window_mask" class="mask hidden"></div>
<div id="popup_display" class="hidden"></div>
<div id="sub_popup_display" class="hidden"></div>
<div id="sub_window_mask" class="mask hidden"></div>
</body>
Thanks for any help! I am stumped at this right now.
In order to have 3 elements into a panel header I tried this :
<div class="panel panel-primary">
<!-- Default panel header contents -->
<div class="panel-heading">
<h4 class="panel-title">
<div class="pull-left">
<h4 class="panel-title"> <i class="glyphicon glyphicon-user"></i>
Users
</h4>
</div>
<div class="header-center">
<pagination class="panel-title" ng-show="totalItems > pageParameters.size" items-per-page="pageParameters.size" boundary-links="true" total-items="totalItems" ng-model="currentPage" ng-change="changePage()"
previous-text="‹" next-text="›" first-text="«" last-text="»"></pagination>
</div>
<div class="pull-right">
<span class="panel-title btn-group">
<button ng-disabled="underCreation" type="button" class="btn btn-default btn-sm" ng-click="addUser()">
<span class="glyphicon glyphicon-plus text-primary"></span>
<span class="text-primary"><strong>Add</strong></span>
</button>
</span>
</div>
</h4>
<div class="clearfix"></div>
</div>
</div>
And .less file corresponding :
.header-center {
display: flex;
justify-content: center;
align-items: center;
}
But this renders :
I need the add button to be aligned with other elements..
You can use bootstrap grids to solve this problem
you can use col-xs-3,col-xs-6,col-xs-3 to create 3 parallel columns
check the code for more clarification http://jsfiddle.net/5doxw0ea/
HTML:
<div class="container">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="container-fluid panel-container">
<div class="col-xs-3 text-left">
<h4 class="panel-title abc">
<i class="glyphicon glyphicon-user"></i>
Users
</h4>
</div>
<div class="col-xs-6 text-center ">
<ul class="pagination panel-pagination">
<li>
<a href="#" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
</li>
<li>1</li>
<li>2</li>
<li>3</li>
<li>
<a href="#" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</div>
<div class="col-xs-3 text-right">
<span class="panel-title btn-group">
<button ng-disabled="underCreation" type="button" class="btn btn-default btn-sm abc" ng-click="addUser()">
<span class="glyphicon glyphicon-plus text-primary"></span>
<span class="text-primary"><strong>Add</strong></span>
</button>
</span>
</div>
</div>
</div>
</div>
</div>
CSS:
.panel-pagination {
margin: 0 0 !important;
}
.panel-container {
padding-right: 0 !important;
padding-left: 0 !important;
height:35px;
}
.abc{
height:35px;
display:table-cell !important;
vertical-align:middle;
}
You could also just move the third div pull-right above the second div header-center if you don't need a full grid there.