All geek questions in one place

    How to align the horizontal line of the `button-group` in the center of a div column?

    <div class="row"> <div class="large-12 columns"> <ul class="button-group "> <li><a class="tiny secondary button" href="#">3 months</a></li> <li><a class="tiny secondary button" href="#">6 months</a></li> <li><a class="tiny secondary button" href="#">9 months</a></li> <li><a class="tiny secondary button" href="#">1 year</a></li> <li><a class="tiny secondary button" href="#">2 years</a></li> </ul> </div> </div> 

    I tried adding text-center to ul as well as large-centered to the column with no success.

    I believe there is a class in foundation to center a group of buttons, but I could not find it.

    http://jsfiddle.net/vZdbY/1/

    +4
    html css alignment zurb-foundation
    gabrielhilal Aug 28 '13 at 14:58
    source share
    2 answers

    Bring ul to li with display: inline-block , and then pass text-align: center parent element of the ul tag.

     .large-12.columns { /* applies to the div which has the both classes */ text-align: center; } ul.button-group{ display: inline-block; } 

    Working violin

    Working script (using display: built-in li unit)

    +7
    Mr_Green Aug 28 '13 at 15:06
    source share

    Just register here if anyone is facing a problem ...

    Based on @Mr_Green's answer, I solved the problem of adding display: inline-block to ul with the new css class, avoiding changes affecting the use of button-group in other parts of my application.

    HTML:

     <div class="row"> <div class="large-12 text-center columns"> <ul class="button-group fix_button_group"> <li><a class="tiny secondary button" href="#">3 months</a></li> <li><a class="tiny secondary button" href="#">6 months</a></li> <li><a class="tiny secondary button" href="#">9 months</a></li> <li><a class="tiny secondary button" href="#">1 year</a></li> <li><a class="tiny secondary button" href="#">2 years</a></li> </ul> </div> </div> 

    CSS

     .fix_button_group{ display: inline-block; } 
    +2
    gabrielhilal Aug 29 '13 at 8:23
    source share

    Source: https://habr.com/ru/post/1499422/

    More articles:

    • WPF ComboBox with Image - c #
    • Counting results without an empty cell without cycling in Excel VBA - for example, with special cells - vba
    • Why does SQL Server 2008 OLE DB UDL explicitly specify port 1433? - sql-server
    • Calculate special expression in C # - c #
    • server server firewalls - sql
    • Using a FOR loop in VHDL with a variable - loops
    • PostgreSQL selects a query to extract latitude and longitude from a point - postgresql
    • How to remove the Eclipse plugin through the command line? - eclipse
    • How to get through attributes in xml via LINQ - c #
    • Opening Ports SQL Server Instances - sql-server

    All Articles

    Geek Questions | 2019