Note that there are some explanatory texts on larger screens.

plurals
  1. POSemantic Markup and Twitter Bootstrap
    primarykey
    data
    text
    <p>I have following HTML:</p> <pre><code>&lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet/less" href="assets/stylesheets/style.less" /&gt; &lt;script src="assets/stylesheets/vendor/less/less-1.3.0.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;nav&gt; &lt;ul class="tabs"&gt; &lt;li class="selected"&gt; &lt;a href="#"&gt;Foo&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Bar&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Baz&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;nav&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>How should I write my style.less to style the list as <a href="http://twitter.github.com/bootstrap/components.html#navs%5D" rel="nofollow">Twitter Bootstrap Basic Tab</a>. The obvious way to do this, to copy and paste all relevant css: </p> <p>$cat style.less</p> <pre><code>@import "vendor/bootstrap/less/bootstrap.less"; .tabs { // .nav margin-left: 0; margin-bottom: @baseLineHeight; list-style: none; // common style for tabs and pills .clearfix(); // Give the tabs something to sit on border-bottom: 1px solid #ddd; } .tabs &gt; li { float: left; } // Make links block level .tabs &gt; li &gt; a { display: block; } .tabs &gt; li &gt; a:hover { text-decoration: none; background-color: @grayLighter; } // common style for nav-tabs .tabs &gt; li &gt; a { padding-right: 12px; padding-left: 12px; margin-right: 2px; line-height: 14px; // keeps the overall height an even number } // Make the list-items overlay the bottom border .tabs &gt; li { margin-bottom: -1px; } // Actual tabs (as links) .tabs &gt; li &gt; a { padding-top: 8px; padding-bottom: 8px; line-height: @baseLineHeight; border: 1px solid transparent; .border-radius(4px 4px 0 0); &amp;:hover { border-color: @grayLighter @grayLighter #ddd; } } // Active state, and it's :hover to override normal :hover .tabs &gt; .selected &gt; a, .tabs &gt; .selected &gt; a:hover { color: @gray; background-color: @white; border: 1px solid #ddd; border-bottom-color: transparent; cursor: default; } </code></pre> <p>Is there any better way to achieve this, without much copy and paste? Note: I can not change the HTML file.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload