Why is bootstrap button so wide? - css

I've got a jumbotron class which has to contain a button, but it's strangely extended and that button looks ugly. Why is that so?
HTML
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-md-8">
<button class="btn btn-primary btn-sm">
<span class="glyphicon glyphicon-ok">
Why is this button so wide?
</span>
</button>
</div>
</div>
</div>
</div>
CSS
.jumbotron {
margin: 10px;
}
.row {
margin: 8px 0;
}
If I try to reduce the size of the column, for example, col-md-4, nothing changes.

Your mistake is you wrote the text inside icon span. Here is the fixed code
.jumbotron {
margin: 10px;
}
.row {
margin: 8px 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-md-8">
<button class="btn btn-primary btn-sm">
<span class="glyphicon glyphicon-ok"></span>
Why is this button so wide?
</button>
</div>
</div>
</div>
</div>

in main page use this...
<header>
<div class="container">
<div class="intro-text">
<div class="intro-lead-in">Welcome!!!</div>
<div class="intro-heading">Let's Get Started</div>
Tell Me More
</div>
</div>
</header>
in css
use this
.btn-xl {
padding: 20px 40px;
border-color: #fed136;
border-radius: 3px;
text-transform: uppercase;
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 18px;
font-weight: 700;
color: #fff;
background-color: #fed136;
}
this will solve your problem

Related

create table from divs with hidden rows with CSS

I have created a table of divs with CSS that is made up of parent rows and child rows, but I want the child rows to make them visible or to hide with the help of vuejs. My problem is not how to make them visible / hidden, how to properly align parents with children.
In my example the child row should fit between parent row two and three, but the child row is displayed above the parent row with the number three.
In the example below the irregularities can be seen much better in full screen mode.
Thanks!
.div-table {
display: table;
width: 100%;
table-layout: auto;
font-size: 12px;
color: black;
}
.div-table-head {
display: table-header-group;
background: #e5e5e5;
vertical-align: middle;
}
.div-table-body {
display: table-row-group;
vertical-align: middle;
}
.div-table-tr {
display: table-row;
}
.div-table-th {
display: table-cell;
font-weight: 700;
text-transform: uppercase;
border-bottom: 3px solid #666;
}
.div-table-td {
display: table-cell;
border-bottom: 1px solid #e5e5e5;
}
.div-table-th, .div-table-td {
padding: 6px;
}
.div-table-tr:nth-of-type(odd) {
background: #f8f8f8;
border-top: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
}
.div-table-tr:hover {
background: #ffd;
}
.my-material-icons {
font-size: 13px;
color: gray;
cursor: pointer;
}
.col-span {
position: absolute;
padding: 0;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.3.1/css/uikit.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/material-design-icons/3.0.1/iconfont/material-icons.min.css" rel="stylesheet"/>
<div class='div-table'>
<div class='div-table-head'>
<div class='div-table-th' style="width: 3%">#</div>
<div class='div-table-th' >th2</div>
<div class='div-table-th' >th3</div>
</div>
<div class='div-table-body'>
<!-- parent -->
<div class='div-table-tr'>
<div class='div-table-td'>1 <i title="title" class="material-icons my-material-icons">arrow_drop_down_circle</i></div>
<div class='div-table-td'>td12</div>
<div class='div-table-td'>td13</div>
</div>
<!-- parent -->
<div class='div-table-tr'>
<div class='div-table-td'>2 <i title="title" class="material-icons my-material-icons">arrow_drop_down_circle</i></div>
<div class='div-table-td'>td22</div>
<div class='div-table-td'>td23</div>
</div>
<!-- child -->
<div class='div-table-tr'>
<div class='div-table-td col-span'>
<div class='div-table'>
<div class='div-table-head'>
<div class='div-table-th' style="width: 4%">#</div>
<div class='div-table-th' >th2</div>
<div class='div-table-th' >th3</div>
</div>
<div class='div-table-body'>
<div class='div-table-tr'>
<div class='div-table-td'>1 <i title="title" class="material-icons my-material-icons">arrow_drop_down_circle</i></div>
<div class='div-table-td'>td12</div>
<div class='div-table-td'>td13</div>
</div>
<div class='div-table-tr'>
<div class='div-table-td'>2 <i title="title" class="material-icons my-material-icons">arrow_drop_down_circle</i></div>
<div class='div-table-td'>td22</div>
<div class='div-table-td'>td23</div>
</div>
</div>
</div>
</div>
</div>
<!-- parent -->
<div class='div-table-tr'>
<div class='div-table-td'>3 <i title="title" class="material-icons my-material-icons">arrow_drop_down_circle</i></div>
<div class='div-table-td'>td32</div>
<div class='div-table-td'>td33</div>
</div>
</div>
</div>
Firts of all instead of use div labels to build a table you should use the vuejs markup https://v2.vuejs.org/v2/examples/grid-component.html

CSS text side by side same height

I am trying to make this text
but how can I make it same height and make inline each other
<div class="row">
<div class="col-xs-12 text-center">
<p style="display:inline">初期費用 <br> 月額費用 <br>手続き料</p>
<h3 style="display:inline">0<span>円</span></h3>
</div>
</div>
Try this:
p, h3{
display: inline-block;
}
h3 {
color: skyblue;
font-size: 70px;
}
<div class="row">
<div class="col-xs-12 text-center">
<p>初期費用 <br> 月額費用 <br>手続き料</p>
<h3>0<span>円</span></h3>
</div>
</div>
Using display flex
.col-xs-12 {
display: flex;
align-items: center;
padding: 0;
}
p {
font-size: 16px;
line-height: 1.5;
margin-right: 8px;
}
h3 {
font-size: 102px;
margin: 0;
}
h3 span {
font-size: 32px
}
<div class="row">
<div class="col-xs-12 text-center container">
<p>初期費用 <br> 月額費用 <br>手続き料</p>
<h3>0<span>円</span></h3>
</div>
</div>
Here you go with a solution
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet"/>
<div class="row">
<div class="col-xs-12 text-center">
<div style="display: flex;">
<p style="display: inline-flex">初期費用 <br> 月額費用 <br>手続き料</p>
<h3 style="display: inline-flex">0<span>円</span></h3>
</div>
</div>
</div>
Solution using flex & inline-flex

Bootstrap page print

I want to print a bootstrap page. Here is my page layout
<div class="container">
<div class="row">
<div class="col-sm-4">
<img src="image/logo.png">
</div>
</div>
</div>
<div class="container" id="student">
<div class="row">
<div class="col-sm-4">
<h1>Student</h1>
</div>
<div class="col-sm-offset-2 col-sm-6" id="date">
<form class="form-inline">
<div class="form-group">
<label for="focusedInput"> <b>Date:</b></label>
<input class="form-control" id="focusedInput" type="text" placeholder="DD Month Year">
</div>
</form>
</div>
</div>
</div>
Also I've css
#font-face {
font-family: "myfont";
src: url("../fonts/opensans/OpenSans-Regular 2.ttf");
}
body{
font-family: "myfont";
/*-webkit-print-color-adjust: exact;*/
}
img{
width: 150px;
}
#student{
margin-top: 50px;
}
#date{
background: black;
margin-top: 20px;
color: white;
padding: 10px;
}
Problem is: css is not loading properly. I tried searching stackoverflow but did not get any exact solution. How can I do that?
Here is the fiddle https://jsfiddle.net/wc6rga7o/
try
#media print {
/* Your styles here */
body{
color: #111111;
}
#date{
-webkit-print-color-adjust: exact!important;
}
}
updated your fiddle https://jsfiddle.net/wc6rga7o/2/

Extra space appears when using :before selector

I'm not a CSS specialist. I have a DRUPAL site, using a theme based on bootstrap. I use the bootstrap alert boxes in order to display important messages on the homepage. It works well, except that I get extra space when adding some content in a :before selector. I created a fiddle
Is there a simple way to solve this extra space? I solved the issue by setting line-height to 0 to the ancestor of the alert, but then when reducing the page, text doesn't go to new line and gets imbricated with itself.
Thanks for help.
Here is the code:
#top-content .block .views-row::before {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
color: #f37021;
content: "\e101";
display: inline-block;
font-family: 'Glyphicons Halflings';
font-size: 2em;
font-style: normal;
font-weight: 400;
left: 0.35em;
/*line-height: 1;*/
position: relative;
top: 0.3em;
}
/*#top-content .block .views-row {
padding-bottom:1.2em;
}*/
#top-content .block .views-row .views-field {
margin-left: 3em;
}
#top-content .block a {
color: #f37021;
}
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" />
<div id="top-content">
<div class="container clearfix">
<div class="clearfix" id="top-content-inside">
<div class="region region-highlighted">
<div class="block block-views contextual-links-region clearfix" id="block-views-alerts-block-1">
<div class="contextual-links-wrapper contextual-links-processed">Configure
<ul class="contextual-links">
<li class="views-ui-edit first">Edit view
</li>
<li class="block-configure last">Configure
</li>
</ul>
</div>
<div class="content">
<div class="view view-alerts view-id-alerts view-display-id-block_1 view-dom-id-281661d0f4b7c5128ce6ef7abc38dfb1">
<div class="view-content">
<div class="views-row views-row-1 views-row-odd views-row-first alert alert-info fade in">
<div class="views-field views-field-nothing"> <span class="field-content"><a aria-label="close" data-dismiss="alert" class="close" href="#">×</a></span>
</div>
<div class="views-field views-field-title"> <span class="field-content">WIV-ISP closed between 1st and 5th of November</span>
</div>
</div>
<div class="views-row views-row-2 views-row-even views-row-last alert alert-info fade in">
<div class="views-field views-field-nothing"> <span class="field-content"><a aria-label="close" data-dismiss="alert" class="close" href="#">×</a></span>
</div>
<div class="views-field views-field-title"> <span class="field-content">Treinramp in Wetteren</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Add float:left and remove top:0.3em
#top-content .block .views-row::before {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
color: #f37021;
content: "\e101";
display: inline-block;
font-family: 'Glyphicons Halflings';
font-size: 2em;
font-style: normal;
font-weight: 400;
left: 0.35em;
line-height: 1; //uncommented this
float:left; //added this
position: relative;
/*top:0.3em*/ //removed this
}
Demo Here
Here it is positioned to the left of your content.
It looks like you were targeting the wrong div with your before. I also added a left to give it a bit of space. see the result below
Changed the target div from:
#top-content .block .views-row::before
to:
.views-field-title .field-content:before
Updated the left to:
left: -10px;
The results are below:
.views-field-title .field-content:before {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
color: #f37021;
content: "\e101";
display: inline-block;
font-family: 'Glyphicons Halflings';
font-size: 2em;
font-style: normal;
font-weight: 400;
/*line-height: 1;*/
position: relative;
top: 0.3em;
left:-10px;
}
/*#top-content .block .views-row {
padding-bottom:1.2em;
}*/
#top-content .block .views-row .views-field{
margin-left: 3em;
}
#top-content .block a {
color: #f37021;
}
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"/>
<div id="top-content">
<div class="container clearfix">
<div class="clearfix" id="top-content-inside">
<div class="region region-highlighted">
<div class="block block-views contextual-links-region clearfix" id="block-views-alerts-block-1">
<div class="contextual-links-wrapper contextual-links-processed">Configure<ul class="contextual-links"><li class="views-ui-edit first">Edit view</li>
<li class="block-configure last">Configure</li>
</ul></div>
<div class="content">
<div class="view view-alerts view-id-alerts view-display-id-block_1 view-dom-id-281661d0f4b7c5128ce6ef7abc38dfb1">
<div class="view-content">
<div class="views-row views-row-1 views-row-odd views-row-first alert alert-info fade in">
<div class="views-field views-field-nothing"> <span class="field-content"><a aria-label="close" data-dismiss="alert" class="close" href="#">×</a></span> </div>
<div class="views-field views-field-title"> <span class="field-content">WIV-ISP closed between 1st and 5th of November</span> </div> </div>
<div class="views-row views-row-2 views-row-even views-row-last alert alert-info fade in">
<div class="views-field views-field-nothing"> <span class="field-content"><a aria-label="close" data-dismiss="alert" class="close" href="#">×</a></span> </div>
<div class="views-field views-field-title"> <span class="field-content">Treinramp in Wetteren</span> </div> </div>
</div>
</div> </div>
</div>
</div>
</div>
</div>
</div>

Working on page flow in responsiveness using css and images

I am working on the below reference image work on responsiveness using css media query and images. I am trying to avoid position I am not getting the excact output which I required.
Here is my Fiddle link
Here is my HTML Code
<div class="container-fluid">
<div class="row-fluid">
<div class="flw_width">
<label class="pull-left flw_text green_prog_text">Basic Information</label>
<div class="col-xs-4 col-sm-4 col-md-1">
<div class="flw_circle_green">
</div>
</div>
<div class="col-xs-4 col-sm-4 col-md-3">
<div class="green_prog">
</div>
</div>
<label class="pull-left flw_text cst_text">Education & Health</label>
<div class="col-xs-4 col-sm-4 col-md-1">
<div class="flw_circle_grey">
</div>
</div>
<div class="col-xs-4 col-sm-4 col-md-3">
<div class="grey_prog">
</div>
</div>
<label class="pull-left flw_text cst_text">Attach & Declaration</label>
<div class="col-xs-4 col-sm-4 col-md-1">
<div class="flw_circle_grey">
</div>
</div>
<div class="col-xs-4 col-sm-4 col-md-3">
<div class="grey_prog">
</div>
</div>
<label class="pull-left flw_text pay_text">Payment</label>
<div class="col-xs-4 col-sm-4 col-md-1">
<div class="flw_circle_grey">
</div>
</div>
</div>
</div>
</div>
My CSS Code
.flw_width{
width: 480px;
margin: 0px auto;
padding-top:45px;
padding-bottom: 60px;
}
.flw_text{
font-size: 13px;
color: #ced3d0;
font-family: 'Open Sans', sans-serif;
width: 0px;
white-space: nowrap;
margin-top: -35px;
margin-left: -45px;
border:0px;
}
.flw_text, .cst_text{
margin-left: -46px !important;
}
.pay_text{
padding-left:26px;
}
.flw_circle_grey{
background: url(../images/grey_Circle.jpg) no-repeat;
width: 20px;
height: 20px;
margin-left: -35px;
margin-top: -7px;
}
.flw_circle_green{
background: url(../images/green_Circle.jpg) no-repeat;
width: 20px;
height: 20px;
margin-top: -6px;
margin-left: 0px;
}
.grey_prog{
background-color: #ced3d0;
height: 6px;
margin-left: -24px;
border: 1px solid #bdbdbd;
}
.green_prog_text{
color: #84bd00;
}
.green_prog{
background-color: #84bd00;
height: 6px;
margin-left: -24px;
}
My current output was like this.
Here is the reference image. Kindly help me I was struggling like anything.
Please do the needful.
You have selected the column grid wrongly, I think For the class which are representing the font awesome circle (green dot) fa fa-circle flw_circle_green can be changed to single grid where you have defined a 4 column grid.
Try updating the four column grid to one column 1 column and use the

Resources