Programmer 400 Programmer 400 - 1 year ago 94
Javascript Question

Small strange rendering bug

There are two small "bugs" when I render my CSS tabs. If I press the third tab then the vertical line to the left disappears. In the example in the manual from it doesn't happen and the line is there when I press "third". I wonder what can be wrong with the code.

$(function () {
$('.menu .item').tab();

<link href="" rel="stylesheet" />
<script src=""></script>
<script src=""></script>
<div class="ui top attached tabular menu">
<a class="item active" data-tab="first">First</a>
<a class="item" data-tab="second">Second</a>
<a class="item" data-tab="third">Third</a>
<div class="ui bottom attached tab segment active" data-tab="first">
<div class="ui bottom attached tab segment" data-tab="second">
<div style="margin-right:0px;margin-left:0px" class="ui bottom attached tab segment" data-tab="third">

If you compare pressing "second" to "third" then the vertical line to the left disappears which it should not do. Can you find the error?

Answer Source

If you look at the .ui.attached.segment class form semantic.min.css , it has a margin: 0 -1px which adds a margin left and right of -1px.

For the second tab, this margin seems to be overriden by whereas its not overriden for the third one.

A simple fix would be to add a margin-right/left of 0px to the third tab

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download