Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7720887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:47:02+00:00 2026-06-01T03:47:02+00:00

I’m quite new to this, but i cannot figure out the problem. In twitter

  • 0

I’m quite new to this, but i cannot figure out the problem.

In twitter bootstrap i would use :

<div class="row-fluid">
  <div class="span2">Column1</div>
  <div class="span6">Column2</div>
</div>

And it all works fine. But i do not want to write spanX and spanY directly into my html file, rather i would like to give meaningful class names, for example:

<div class="user-container">
  <div class="user-filter">First Column</div>
  <div class="user-list">Second Column</div>
</div>

Given the fact, that i’m using https://github.com/thomas-mcdonald/bootstrap-sass, how should i write my scss file? I’ve tried the following, and it does not work (two columns are not displayed):

@import "bootstrap";
@import "bootstrap-responsive";

.user-container {
    @extend .row-fluid;
}

.user-filter {
    @extend .span2;
}

.user-list {
    @extend .span10;
}

If i look at the generated code, it seems to me that everything should be ok:

/* line 164, ../../../../../.rvm/gems/ruby-1.9.3-p125/gems/bootstrap-sass-2.0.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span2, .user-filter {
  width: 140px;
}

and so on.

What am i doing wrong?

UPDATE:

ok, just to be clear what is wrong – the columns are laid out as rows (one after another) rather like true columns (one next to each other), eg.:

with bootstrap: Column1 Column2
with my custom classes:
First Column
Second Column

I’ve inspected the elements layout in Chrome and it seems that bootstrap classes have float property, and mine – no. Looking at css source i see classes like this:

[class*="span"] {
  float: left;
  margin-left: 20px;
}

So in my case i think it should generate something like :
[class*=”user-filter”] {
float: left;
margin-left: 20px;
}

or not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:47:03+00:00Added an answer on June 1, 2026 at 3:47 am

    It’s your use of @extend, or rather, Sass’ inability to deal with wildcard class matching, which is rather unsurprising, since it gets rather complex.

    Bootstrap uses a number of what I might refer to as ‘nonstandard’ methods to address some classes. You’ve mentioned one of those in your post above – [class*="span"].

    Naturally, when you use @extend x, Sass is extending the x class. Unfortunately, it (currently) has no way of knowing that a wildcard matcher also affects the output of the class. So yes, in an ideal world, [class*="span"] would also be extended to define [class*="span"], .user-filter, but Sass can’t currently do that.

    While extending .row-fluid is enough to include the rules nested underneath it wrt. the span classes, as per above, it won’t adjust the wildcards for extended spans.

    bootstrap-sass already had a mixin for fixed width columns/rows, makeRow() and makeColumn(). I’ve just pushed a makeFluidColumn() mixin, that, well, makes a fluid span. Your code would then become:

    .user-container {
      @extend .row-fluid;
    }
    
    .user-filter {
      @include makeFluidColumn(2);
    }
    
    .user-list {
      @include makeFluidColumn(10);
    }
    

    Unfortunately (as per usual) it’s not quite so simple. Bootstrap uses this snippet to reset the margin on the first spanx class that is a child of the row.

    > [class*="span"]:first-child {
      margin-left: 0;
    }
    

    However, we cannot redefine this for each call of makeFluidColumn, and so we must manually set no margin-left on any element that will be the first child of a fluid row. It’s also worth noting that mixing spanx classes and makeFluidColumn classes will cause the first spanx class to have its margin reset, regardless of whether it’s actually the first column in the row.

    Your code would therefore be

    .user-container {
      @extend .row-fluid;
    }
    
    .user-filter {
      @include makeFluidColumn(2);
      margin-left: 0; // reset margin for first-child
    }
    
    .user-list {
      @include makeFluidColumn(10);
    }
    

    It’s not a particularly pretty solution, but it works, and is all to do with how Bootstrap uses wildcard class matching, as you gathered in your question update. I’ve only just pushed this to the 2.0.2 branch, so you’ll have to use Bundler with Git to install it, but I’m hoping for a release in the next couple of days.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
Seemingly simple, but I cannot find anything relevant on the web. What is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.