Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The way I've always done this in the past is to give the body a class, then each tab a class (or id), then use those in the CSS. </p> <pre><code>&lt;!-- the tabs now have a class you can use --&gt; &lt;div id="tabs"&gt; &lt;ul&gt; &lt;li class="tabone"&gt;&lt;a href="/"&gt;Courses&lt;/a&gt;&lt;/li&gt; &lt;li class="tabtwo"&gt;&lt;a href="#"&gt;My Courses&lt;/a&gt;&lt;/li&gt; &lt;li class="tabtre"&gt;&lt;a href="#"&gt;Administration&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>first page</p> <pre><code>&lt;body class="tabonepage"&gt;... </code></pre> <p>secondpage</p> <pre><code>&lt;body class="tabtwopage"&gt;... </code></pre> <p>css - this gets a bit verbose, but it's localised to one spot. As long as you don't have 493 tabs, you'll be golden</p> <pre><code>.tabonepage .tabone, .tabtwopage .tabtwo, .tabtrepage .tabtre, { padding-bottom: 1px; background: white; border-bottom: 1px solid white; } </code></pre> <hr> <p><strong>edit</strong> as for how I've gotten the class in...</p> <p>This is where I hang my head in shame. I usually put a property on my main master called BodyClass, then put a bit of code in OnPreRender that sets said property, and put an expression hole into the main master. It's not real pretty, but I live with it, the benefits of having a body class far outweigh the codebehind in my eyes :-) There's probably a way that doesn't involve codebehind, I've never really investigated it fully. I get the feeling MVC would help.</p> <p>MainMaster.Master:</p> <pre><code>&lt;body class='&lt;%=BodyClass%&gt;'&gt; </code></pre> <p>MainMaster.Master.cs</p> <pre><code>public string BodyClass{ get; set; } </code></pre> <p><em>everyotherpage</em>.aspx (I can't remember if this was needed, I think it's so you have strongly typed access to the BodyClass property in the codebehind)</p> <pre><code>&lt;%@ MasterType VirtualPath="~/MasterPages/MainMaster.Master" %&gt; </code></pre> <p><em>everyotherpage</em>.aspx.cs</p> <pre><code> protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); this.Master.BodyClass = "areamydetails"; } </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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