Thanks Selim Tuvi for your reply. I&#39;ve created a tab bar and i set that for the tabwidget. But when i tried to set the stylesheet properties like right-margin:5 and left-margin:5 it didn&#39;t work. However i think this property must be set for the tab2 alone.. How to get an instance for tab2?? To my dismay this link didn&#39;t work as well.. <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/stylesheet.html">http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/stylesheet.html</a> .Here is the sample code with which I tried this code but didn&#39;t work. Correct me please..<br>
<br>from PyQt4 import QtCore, QtGui<br>import sys<br>class Ui_TabWidget(object):<br>    def setupUi(self, TabWidget):<br>        TabWidget.setObjectName(&quot;TabWidget&quot;)<br>        TabWidget.resize(400, 300)<br>        tabBar=QtGui.QTabBar(TabWidget)<br>
        tabBar.addTab(&quot;Tab1&quot;)<br>        tabBar.setTabText(0,&quot;hello&quot;)<br>        tabBar.addTab(&quot;Tab2&quot;)<br>        tabBar.setTabText(1,&quot;hai&quot;)<br>        tabBar.setStyleSheet(&quot;QTabBar{margin-left: 5;margin-right: 5;}&quot;)<br>
        TabWidget.setTabBar(tabBar)<br>        self.retranslateUi(TabWidget)<br>        QtCore.QMetaObject.connectSlotsByName(TabWidget)<br>        <br>    def retranslateUi(self, TabWidget):<br>        TabWidget.setWindowTitle(QtGui.QApplication.translate(&quot;TabWidget&quot;, &quot;TabWidget&quot;, None, QtGui.QApplication.UnicodeUTF8))<br>
        <br>app = QtGui.QApplication(sys.argv)<br>TabWidget = QtGui.QTabWidget()<br>ui = Ui_TabWidget()<br>ui.setupUi(TabWidget)<br>TabWidget.show()<br>sys.exit(app.exec_())<br><br>                               <br>