How to adjust the alignment of YUI tabs?

In the following example:

http://developer.yahoo.com/yui/examples/tabview/frommarkup_clean.html

I would like the tabs to be right-aligned and keep the current order.

I'm sure this is something simple - too close to see a solution.

0


source to share


4 answers


Top my head, how about:




<div id="demo" class="yui-navset">
    <ul class="yui-nav" style="text-align:right;">
        <li><a href="#tab1"><em>Tab One Label</em></a></li>
        <li class="selected"><a href="#tab2"><em>Tab Two Label</a></li>
        <li><a href="#tab3"><em>Tab Three Label</em></a></li>
    </ul>            
    <div class="yui-content">
        <div id="tab1"><p>Tab One Content</p></div>
        <div id="tab2"><p>Tab Two Content</p></div>
        <div id="tab3"><p>Tab Three Content</p></div>
    </div>
</div>

      

+1


source


Have you tried applying "text-align: right;" to the container div:

<div id="demo" class="yui-navset">

      



?

0


source


What da5id and Kevin Le said.

In your CSS file add this line: ul.yui-nav {text-align: right; }

This is the same solution.

0


source


HTML code:

<div id="demo" class="yui-navset">
<div class ="tabs-nav" >
    <ul class="yui-nav" >
        <li><a href="#tab1"><em>Tab One Label</em></a></li>
        <li class="selected"><a href="#tab2"><em>Tab Two Label</a></li>
        <li><a href="#tab3"><em>Tab Three Label</em></a></li>
    </ul>  
</div>          
    <div class="yui-content">
        <div id="tab1"><p>Tab One Content</p></div>
        <div id="tab2"><p>Tab Two Content</p></div>
        <div id="tab3"><p>Tab Three Content</p></div>
    </div>
</div>

      

CSS

div.tabs-nav {height: 45px;} /* important to set div height so your tabs navigation does not fall in to the tabs content */
ul.yui-nav { float: right;}
ul.yui-nav li { float: left;}

      

0


source







All Articles