bootstrap col is not fitting - html

When I look at my website "services" on an ipad landscape view, my services are going down one row. I have inspected the developer tools, and can see if I untick the bootstrap 33.3 %, each service will get 50%.
But I cannot see how I can get each one to fill 33.3%, when the bootstrap has defined it. I also defined how many col the div class should use. I looked through my CSS, and I do not have any padding, margin or so that should cause this.
<!-- begin services section -->
<section class="services">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="service small">
<i class="fa fa-paper-plane-o"></i>
<h3>AutoPilotHQ</h3>
<p>
I startet to have quite some experience building quality leads through journeys and landingpages. I have made scripts that can be integrated with several platforms.
</p>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="service small">
<i class="fa fa-tablet"></i>
<h3>Mautic</h3>
<p>
I like the idea about open source marketing automation. I am currently working on different functions to generate and build more qulity leads.
</p>
</div>
</div>
</div>
</div>
</section>

CSS can be tricky.
The icon of service <i class="fa fa-paper-plane-o"></i> is set to float: left; and it brakes the layout.
Add this rule to fix it:
.service.small:after {
content: " ";
clear: both;
display: table;
}
Disabling the following CSS rule also repairs your layout (I am not sure why):
.services .service {
margin-bottom: 30px;
}

Related

To set the background image in wrapper class

I write these code and made 2 grid using bootstrap.Now i want to the backgound image in the wrapper class.I tried it but i din't get success. Any idea about this?
.wrapper {
background-image: url(http://www.steamatic.com/images/footer-pattern-grey.jpg);
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
<div class="wrapper">
<div class="col-md-6">
<div class=" flex">
<div class="media-left"> <i class="fa fa-home fa-3x"></i></div>
<div class="media-body">
<h4>Resenditial Services</h4>
</div>
</div>
<p class="para">Steamatic knows that the health and safety of your family is your first concern. Our restoration and cleaning services are all about providing you with the healthiest indoor environment possible.</p>
</div>
<div class="col-md-6">
<div class=" flex">
<div class="media-left"> <i class="fa fa-building fa-3x"></i></div>
<div class="media-body">
<h4>Commercial Services</h4>
</div>
</div>
<p class="para">We've been providing commercial clients money-saving and asset-protecting services for nearly five decades. Steamatic's full range of restoration and cleaning services means we have your business covered.</p>
</div>
</div>
I get the image in my background but i want to get full width image what i do?
U can show the image i upload
If you read the documentation of bootstrap, the cols are always wrapped in a row , if you want to wrap it in your own .wrapper class, then add
.wrapper{
overflow: hidden;
}
or you can try float: left; to .wrapper , its your choice
Add overflow: auto; to your .wrapper element.
You have to add overflow: hidden to your .wrapper class parent element of the two floating elements inside of it. So that if you add background image on your .wrapper it will show. Because, bootstrap grid classes are using float.

How to make header image resize with responsive WP theme

I am trying to use the Enigma theme on my WP site.
It allows you to add a logo about 200px wide which works with the responsiveness of the site.
However, I want to upload a much wider image, which then resizes as the screen gets smaller.
I added a class to the image file and tried to target it with css
max-width: 100%;
height: auto;
I am familiar with media queries but nothing I do is working.
Here is the theme, this is an example site, not the real site I am working on but it presents the same problem.
http://bestgirlsonearth.com
I've erased my work on it just to show the theme as is.
Due to fluid-system-column of bootstrap your image is located in a 6col "col-md-6" and by definition that class can't take more space or less than her parents middle weight (here row)
I'm not a user of Twitter Bootstrap but i think you should change in your header.php to have two rows and your full-sized img :
<div class="row ">
<div class="col-md-6 col-sm-12">
<div class="logo">
<a href="http://bestgirlsonearth.com/" title="Best Girls on Earth" rel="home">
<img src="http://bestgirlsonearth.com/wp-content/uploads/2014/10/bgeheader3.png" style="height:182px; width:1023px;">
</a>
<p>The finest women on the planet</p>
</div>
</div>
<div class="col-md-6 col-sm-12">
<ul class="head-contact-info">
//you contact info
</ul>
</div>
</div>
by this :
<div class="row ">
<div class="col-md-12 col-sm-12">
<div class="logo">
<a href="http://bestgirlsonearth.com/" title="Best Girls on Earth" rel="home">
<img src="http://bestgirlsonearth.com/wp-content/uploads/2014/10/bgeheader3.png" style="/* height:182px; */ /* width:1023px; */"></a>
<p>The finest women on the planet</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<ul class="head-contact-info">
// Your contact infos
</ul>
</div>
</div>
cheers,

bootstrap mobile first layout issue

Please check my demo .I have been trying to implement this please hover above any plan block with different grid size i have some how managed to make it work all the grid sizes except col-xg(<768px).Here on hover the div breaks and shows irregular behavior.Below i have added the sample how i want block to render <768px grid and on hover block has to change to blackish color
This is the Second Issue uneven height
I am trying to build a page from the scratch and so please be kind enough to point out my mistakes
FIDDLE
HTML
<div id="Container_Plans">
<div class="rows">
<div class="col-lg-2 col-md-2 col-sm-2 ">
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 ">
<div class="products_Container">
<div class="Product_Plan">
<span class="PlanName">
#01
</span>
</div>
<div class="Product_Feature">
<span class="Feature_Content">
<h2>Compact Plan</h2>
<p><span class="break">DDNS Feature for </span>remote viewing </p>
<div>
# RS 10000 /-
</div>
free Dns Subscription for a year
</span>
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
<div class="products_Container">
<div class="Product_Plan">
<span class="PlanName">
#02
</span>
</div>
<div class="Product_Feature">
<span class="Feature_Content">
<h2>Regular Plan</h2>
<p><span class="break">DDNS Feature for </span>remote viewing </p>
<div>
# RS 21000 /-
</div>
free Dns Subscription for a year
</span>
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 ">
<div class="products_Container">
<div class="Product_Plan">
<span class="PlanName">
#03
</span>
</div>
<div class="Product_Feature">
<span class="Feature_Content">
<h2>Performance Plan</h2>
<p><span class="break">DDNS Feature for </span>remote viewing </p>
<div>
# RS 45000 /-
</div>
free Dns Subscription for a year
</span>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
</div>
</div>
</div>
It looks like the background changes are being determined on an on-hover css rule for .products_Container. Try setting the rule for its parent, col-lg-3 col-md-3 col-sm-3 col-xs-12, and give the parent the desired on-hover background color.
Does this achieve what you are attempting to accomplishing?
http://jsfiddle.net/sYJKE/2/embedded/result/
You need a clearfix on the products_Containers. The floated elements inside aren't filling their container element, which the clearfix will take care of. Here's Nicolas Gallagher's lovely clearfix (http://nicolasgallagher.com/micro-clearfix-hack/):
.products_Container:before,
.products_Container:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.products_Container:after {
clear: both;
}
/**
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.products_Container {
*zoom: 1;
}
http://jsfiddle.net/EG7v9/2/
Regarding the height difference, the fast and dirty way to fix that is the make the h2 tags the same height no matter what. You can drop a break <br> inside the h2 to split the plan type and the word plan onto two lines:
<h2>Regular <br>Plan</h2>
Just do that for each of the plan h2s.

Bootstrap columns not responsive / fluid

I'm using the Bootstrap CSS Grid System for the first time and I have noticed that in Google Chrome when I resize the window (from small to large) the design is responsive and fluid with the Divs keeping their ratio size. In Mozilla Firefox this isn't the case, although the class="container-fluid" Divs will stretch with the resize the Divs within the row class divs keep their small sizes (they don't get any larger, don't stretch). I tried adding .col-sm-* after the .col-xs-* classes but this has no effect / makes no difference (see the comment in the code). Am I making a silly, nubie error? Can anyone answer my issue whilst I go through the Bootstrap Documentation?
<header>
<div class="container-fluid header">
<div class="row">
<div class="col-xs-2">☰</div>
<div class="col-xs-8 text-center">
<img src="../img/some-image.png" alt="Some Image">
<span class="strapline">Nice Strap line</span>
</div>
<div class="col-xs-2 col-sm-2 text-right"> + </div>
</div>
</div>
<div class="container-fluid search">
<div class="row">
<div class="col-xs-3"></div>
<div class="col-xs-6 text-center"></div>
<div class="col-xs-3 text-right"></div>
</div>
</div>
<!--col-sm-* added here... -->
<div class="container-fluid filter-menu">
<div class="row">
<div class="col-xs-4 col-sm-4 filter-buttons">
Menu Button 1
<span class="filter-green">12.03.14, 12:30</span>
</div>
<div class="col-xs-4 col-sm-4 filter-buttons">
Menu Filter
<span class="green-count">1</span>
</div>
<div class="col-xs-4 col-sm-4 filter-buttons-last">
Sort By
<span class="filter-green">Rating</span>
</div>
</div>
</div>
</header>
Please note that .filter-green, filter-buttons, .filter-menu, .text-center, .text-right, .header and .search are custom CSS classes that I have produced and these don't have any conflict with the Bootstrap Grid
UPDATE **
Please note that I think I may have to use the .row-fluid class and the make columns the same height I added the following overwrite on the following bootstrap class
// bootstrap overwrite...
.row {
display: table;
}
[class*="col-"] {
// float: none;
display: table-cell;
vertical-align: top;
}
I just started using the .row-fluid class instead of .row and I removed my clearfix overwrite which is above. Problem solved!

How to give font-awesomes icon a fixed width?

I am using Bootstrap and Font Awesome to make a table like the one from FAQ zalando.
So on the left side, there should be an icon, and on the right side, there should be text.
I want the text to be exactly under each other, they should not be out of alignment with each other. If I give the icons a span, then it will be ignored.
Here is my code:
<div class="row">
<i class="span2 icon-user "></i>
<div value='register' class="span4">
Registrierung
</div>
<i class="icon-mobile-phone span2"></i>
<div id='Newsletter' class="span4">
Newsletter
</div>
</div>
<div class="row">
<i class="icon-euro span2"></i>
<div value='kost' class="span4">
Kosten
</div>
<i class="icon-phone span2"></i>
<div id='probleme' class="span4">
Probleme
</div>
</div>
As an update to this, FontAwesome now has fixed-width support built in.
<i class="fa fa-fw fa-user"></i>
The fa-fw class supplies the fixed-width style.
Put your icon inside the element and make it behave as an inline-block so you can change its width and margin.
http://jsfiddle.net/LeBen/B9yjd/
Both, the original code of the Zalando website and the Fiddle by LeBen, are not "ideal" - espacially when it comes to HTML semantics.
Why having empty elements if you only want a background image for an element?
Just add the icon as background-image and set the padding-left for all these elements to the required value.
Just target the icons classes directly adding your styles in css:
[class*="btn-"]:before,
[class^=" btn"]:before {
margin-right: 1em;
}
And there's no need for an empty , just use:
<div class="row">
<div value='register' class="icon-user span4">
Registrierung
</div>
<div id='Newsletter' class="icon-mobile-phone span4">
Newsletter
</div>
</div>
just had this issue playing around with the options after not wanting to bang all my FontAwesome icons in spans/divs. Adding class 'fa-fw' did indeed solve it, but so does simply adjusting the width of the icon with CSS (maybe a new thing as this is an old post), so no extra classes needed if you have many icons. 'svg-inline--fa' was a common class for all my icons - see example
.item{
padding: 5px;
}
.svg-inline--fa{
font-size: 20px;
width: 40px !important;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js" defer></script>
<div class="item">
<i class="fas fa-bolt"></i>
Fast, local and friendly team
</div>
<div class="item">
<i class="fas fa-tags"></i>
Honest and transparent pricing
</div>
<div class="item">
<i class="fas fa-handshake"></i>
All our work is guaranteed
</div>
<div class="item">
<i class="fas fa-clipboard-check"></i>
Trained to the highest UK standards
</div>