Bootstrap column issue

Hi,

Could someone please have a look at this page for me.

http://church.webdevsvr.com/cg/

The blue and red columns should be floated side by side  but they seem to be stretching full width.

I'm using bootstrap and it's the first time I've attempted to use it. It seems to me like the columns are not taking on any styles from the CSS, but I've no idea why.

Am i missing something?
SheppardDigitalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dean OBrienCommented:
use:

<div class="row">
        <div class="span8" style="background: blue; height: 50px;">
        </div>
        <div class="span4" style="background: red; height: 50px;">
        </div>
    </div>

Open in new window

Easynow
0
SheppardDigitalAuthor Commented:
Nope, hasn't changed anything

http://church.webdevsvr.com/cg/

I'm using bootstrap 3.
0
Dean OBrienCommented:
Looks like your bootstrap css has been scaled down or something as it has no definition for span4 etc. Did you customize and untick scaffolding?

Unless im missing something, im pretty sure span4 etc are crucial
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

SheppardDigitalAuthor Commented:
Not according to the documentation?

http://getbootstrap.com/css/#grid
0
Julian HansenCommented:
The blue and red columns should be floated side by side  but they seem to be stretching full width.
Ok, but nowhere are you specifying either that the elements should be floated nor are you specifying a width for the blocks.

You need to do both to achieve the desired effect.

Something like this
<div style="background: none repeat scroll 0% 0% blue; height: 50px; display: inline-block; width: 49.5%;" class="span8">
        </div>
<div style="background: none repeat scroll 0% 0% red; height: 50px; display: inline-block; width: 49.5%;" class="span4">
        </div>

Open in new window


In this example the style inline-block is used but you could use float instead.
The widths are set to 50% and 49.5% because the div's being on separate lines with display: inline-block means there is a space between them. You can eliminate this by either

a) Using float instead of inline-block
<div class="row" style="font-size: 0;">
        <div style="background: none repeat scroll 0% 0% blue; height: 50px; float: left; width: 50%;" class="span8">
        </div>
        <div style="background: none repeat scroll 0% 0% red; height: 50px; float: right; width: 50%;" class="span4">
        </div>
    </div>

Open in new window

b) Removing the space between the elements
<div class="row" style="font-size: 0;">
        <div style="background: none repeat scroll 0% 0% blue; height: 50px; display: inline-block; width: 50%;" class="span8">
        </div><div style="background: none repeat scroll 0% 0% red; height: 50px; display: inline-block; width: 50%;" class="span4">
        </div>
    </div>

Open in new window

c) Setting a font-size of 0 to the <div class="row"> parent
<div class="row" style="font-size: 0;">
        <div style="background: none repeat scroll 0% 0% blue; height: 50px; display: inline-block; width: 50%;" class="span8">
        </div>
        <div style="background: none repeat scroll 0% 0% red; height: 50px; display: inline-block; width: 50%;" class="span4">
        </div>
    </div>

Open in new window

All three options will allow you to have both blocks side by side with a width of 50%;
In these examples the styles are inline - in practice it would be better to style this in your style sheet.
0
SheppardDigitalAuthor Commented:
@julianH

I thought the whole purpose of bootstrap was that you define how many grid columns you wanted the DIV to span and it did the rest.

If you look at the bootstrap css file you'll see there are definitions in there for the divs and there's also %widths, but for some reason they are not being defined.
0
Dean OBrienCommented:
OK, i was looking at the previuous version of bootstrap...

I think the solutionmay be very simple... you seem to have included a dot in your class names. You only define the class in the css with a dot.

Eg.

HTML

<div class="myclass">

CSS

.myclass{....}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
Yup - that is the idea - except none of those styles are coming through.

Neither span4 nor span8 is in your bootstrap.css
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
The problem is you are using the wrong code.  Boostrap3 changed the classes.  It is actually much easier now but a quick learning curve.  It threw me for a loop the first project I used bootstrap 3 especially because they kept updating it.

<div class="row">
  <div class="col-md-8">.col-md-8</div>
  <div class="col-md-4">.col-md-4</div>
</div>

Open in new window


http://getbootstrap.com/css/#grid
0
SheppardDigitalAuthor Commented:
@julianH

because according to the bootstrap documentation I don't need to use it?
0
Dean OBrienCommented:
Did you try removing the dot as i suggested?
0
SheppardDigitalAuthor Commented:
@padas

Yep, your solution works, however that's very similar to what I had originally?

ah, I know where I went wrong, for some reason I included a (period) in the class name on the DIV!!!

I've been building websites for over 14 years and I've made a school boy error!
0
Dean OBrienCommented:
lol, please go back and read my previous two posts... (am i invisible?)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.