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 8259839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:57:19+00:00 2026-06-08T02:57:19+00:00

I want to make a LESS style like so: .td-middle50 { line-height:50px; vertical-align:middle; }

  • 0

I want to make a LESS style like so:

.td-middle50
{
   line-height:50px;
   vertical-align:middle;
}

that I can apply to to make all the elements have a line-height of 50px and be vertically aligned.

Where 50 is a variable.

This is as far as I have got:

.td-middle(@vheight){
    line-height:(@vheight);
    vertical-align:middle;
}

But this:
A) Doesn’t even work
B) I would have to apply to each td instead of the tr

  • 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-08T02:57:21+00:00Added an answer on June 8, 2026 at 2:57 am

    Take a look on how .span1–.span12 classes are being defined in Twitter Bootstrap’s LESS files (source). They are defined using so called “mixins” (see example here) that are then executed (example here).

    From Bootstrap’s code (mixins.less):

    // The Grid
    #grid {
      .core (@gridColumnWidth, @gridGutterWidth) {
        .spanX (@index) when (@index > 0) {
          (~".span@{index}") { .span(@index); }
          .spanX(@index - 1);
        }
        .spanX (0) {}
        /* ... a lot of code here ... */
      }
      /* ... other code ... */
    }
    

    Usage of mixins (within grid.less):

    // Fixed (940px)
    #grid > .core(@gridColumnWidth, @gridGutterWidth);
    
    // Fluid (940px)
    #grid > .fluid(@fluidGridColumnWidth, @fluidGridGutterWidth);
    

    Good start would be to learn more about mixins: http://lesscss.org/#-mixins

    But I have one advice: if you want this to work for every value of mentioned “variable”, then stop. This must be compiled to CSS and CSS will not make you able to do what you wanted (to apply styles dynamically for every class matching criteria, based on part of the class’s name), better rethink your idea.

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

Sidebar

Related Questions

I want to make layout that take 100% of the screen height (min) with
Layout is FreeDesign I want to make less space between JLabel and JFrame in
I want make interactive application where user launches it and can do various task
I have style sheet with a class name changebackgroundcolor i want make change in
Let's say that I have a style defined using Less: ul.unstyled, ol.unstyled { margin-left:
Let's say I have a todo app, and I want to make sure that
i want to make a select, where the users birthday(date field) is less than
I want to make the int in IDictionary<int, Driver> a little less obscure about
I want to make a simple image viewing program, that just takes the images
I want to draw two lines that go through three points, and make a

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.