473,833 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tabs using CSS

Folks,
I'm trying to implement a tabbed effect with CSS and HTML - no
graphics.
for some reason, i'm unable to control the width of the tabs. I've
pasted the code below.
Any help / pointers to resources that explain how to implement tabs
with CSS would be great.
Thanks,
LP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"

/>
<title>Untitl ed Document</title>
<style>
..box1{
display:inline;
z-index:1;
width:2em;
position:relati ve;
white-space:nowrap;
border-left: solid #000000 1px;
border-right: solid #000000 1px;
border-top: solid #000000 1px;
border-bottom: solid #FFFFFF 1px;
text-align:center
bottom: -1px;
padding-left: 2px;

}
..box4{
position: relative;
background-color: none;
width: 5em;
border:none;
border-bottom: solid #000000 1px;
float: left;
z-index:1;
text-align: right;

}
..box5{
width: 3px;
border: none;
float: left;
display:inline;
z-index:1;
}
..box6{
position:relati ve;
width:100%;
z-index: -2;
border: solid #000000 1px;
height: 100px;
top: -1px;
}
</style>
</head>
<body>
<div class="box4">
<li class="box1">te st</li>
</div>
<div class="box5"></div>
<div class="box4">

<li class="box1">te st2</li>
</div>
<div class="box5"></div>
<div class="box4">
<li class="box1">te st3</li>
</div>
<div class="box6"></div>
</body>
</html>

Jan 27 '06 #1
21 2701
VK

listaction wrote:
Folks,
I'm trying to implement a tabbed effect with CSS and HTML - no
graphics.
for some reason, i'm unable to control the width of the tabs. I've
pasted the code below.
.box1{
display:inline;


Just crossed with my own question...

.box1{
display: -moz-inline-box;
display: inline-block;

(you need block or inline-block for width / height to apply)

Jan 27 '06 #2
that worked! VK thanks a lot for such a quick response.

Jan 27 '06 #3
"VK" <sc**********@y ahoo.com> wrote:
Folks,
I'm trying to implement a tabbed effect with CSS and HTML - no
graphics.
for some reason, i'm unable to control the width of the tabs. I've
pasted the code below.
.box1{
display:inline;


Just crossed with my own question...

.box1{
display: -moz-inline-box;
display: inline-block;

(you need block or inline-block for width / height to apply)


Not smart, inline-block is poorly supported in most slightly older
browsers.

--
Spartanicus
Jan 27 '06 #4
"listaction " <li********@gma il.com> wrote:
I'm trying to implement a tabbed effect with CSS and HTML - no
graphics.


Try Googling before reinventing the wheel for the umpteenth time.

--
Spartanicus
Jan 27 '06 #5
VK

Spartanicus wrote:
"VK" <sc**********@y ahoo.com> wrote:
Folks,
I'm trying to implement a tabbed effect with CSS and HTML - no
graphics.
for some reason, i'm unable to control the width of the tabs. I've
pasted the code below.
.box1{
display:inline;


Just crossed with my own question...

.box1{
display: -moz-inline-box;
display: inline-block;

(you need block or inline-block for width / height to apply)


Not smart, inline-block is poorly supported in most slightly older
browsers.


Yup... That was a part of my question at:
<http://groups.google.c om/group/comp.infosystem s.www.authoring .stylesheets/browse_frm/thread/c674a6548469179 b/ad75d12650a1d2e d#ad75d12650a1d 2ed>
(I was actually checking for replies when encountered this question).

IE 5.x (?), IE 6.x for sure, FF 1.0.4 or higher, Opera 8.x for sure.

If Safary 2.x or higher supports inline-block then I can live with it
in my particular solutions. But does it?

Jan 27 '06 #6
"VK" <sc**********@y ahoo.com> wrote:
Not smart, inline-block is poorly supported in most slightly older
browsers.


Yup... That was a part of my question at:
<http://groups.google.c om/group/comp.infosystem s.www.authoring .stylesheets/browse_frm/thread/c674a6548469179 b/ad75d12650a1d2e d#ad75d12650a1d 2ed>
(I was actually checking for replies when encountered this question).


Had you checked the archive there would have been no need to ask your
question, luckily for you the archive hasn't closed yet for the day, so
you can still use it.

--
Spartanicus
Jan 27 '06 #7
VK

Spartanicus wrote:
Had you checked the archive there would have been no need to ask your
question, luckily for you the archive hasn't closed yet for the day, so
you can still use it.


Indeed:
<http://homepage.ntlwor ld.com/spartanicus/ie_block_level_ element_inline-block_hack.htm>
etc.

Everyone wants to be lazy sometimes... ;-)

Sorry.

Jan 27 '06 #8
> Try Googling before reinventing the wheel for the umpteenth time.

Perhaps he is doing it as a learning exercise, or he has valid reasons
for doing it... he's asking for help not for a critique of what he
wants to do.

Jan 27 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3437
by: Dan Jacobson | last post by:
In wdg-html-reference/html40/block/pre.html there is no mention about how ASCII tabs (^I) are to be rendered. I suppose all bets are off? Wait, my docs go thru html-tidy first, and it says tab-size: number Sets the number of columns between successive tab stops. The default is 4. It is used to map tabs to spaces when reading files. Tidy never outputs files with tabs. However, in emacs, tab-width's value is 8. Solution:
2
1514
by: Cat | last post by:
Some nice man told me that I can keep tabs in Visual Studio 2005. (Options -> All Languages -> Tabs -> Keep tabs) But I'm using VC#.NET 2005 EXPRESS EDITION, and I can't find Tabs node. Is it impossible to keep tabs in VC#.NET 2005 EXPRESS EDITION? If there is a way please let me know. Thanks.
2
1301
by: Jim Hubbard | last post by:
I need an example of tabs usage like you might do in a tabbed browser application. I need to be able to open one or more tabs with customer data. Every tab is laid out exactly alike, only the customer data changes from tab to tab. Tabs should be able to be created at the front of all tabs, back of all tabs or between any 2 tabs. Double-clicking a tab should delete it. Double-clicking on the tab control (but NOT on a tab) should create...
10
5117
by: John M. Gabriele | last post by:
The following short program fails: ----------------------- code ------------------------ #!/usr/bin/python class Parent( object ): def __init__( self ): self.x = 9 print "Inside Parent.__init__()"
135
7552
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about which is better. It has become what's known as “religious war” — a heated fight over trivia. In this essay, i like to explain what is the situation behind it, and which is proper.
6
1784
by: Stephen Edwards | last post by:
I am a novice, so bear with me. I designed a website using CSS TABS, all was fine, then I copy and pasted meta name, etc for keywords, tweaking it where necessary for keywords. I did not notice any problems until I looked at the site and although the text for the tabs was showing up the images which make up the tabs weren't. I have no idea why this has happened, can I have some advice as to what to check, and how to fix it, thank...
35
2737
by: Ben | last post by:
Hi, I have a python script on a unix system that runs fine. I have a python script on a windows system that runs fine. Both use tabs to indent sections of the code. I now want to run them on the same system, actually in the same script by combining bits and pieces. But whatever I try my windows tabs get converted to spaces when I transfer it to the unix system and the interpreter complains that the indentation style is not consistent...
7
3760
by: Phil Reynolds | last post by:
I'm using a tab control in Access 2000, and the user requested to have buttons in the form header, instead of the built-in tabs (so that when they scroll down, they can still switch tabs). Now, this works fine. However, when I'm in Design View, I can't access the tabs without changing the tab control's Style back to Tabs. But I want to be able to place controls in that space at the top where the tabs used to be. But if I need to turn the...
7
3048
by: Andrew Poulos | last post by:
Is there a way for javascript to know if a browser has been set to open new windows in tabs? I'm trying to fix some code that allows a user to close a window that javascript opened and it seems to get confused what window to close when a new tab is opened. (The user clicks a link in the opened window which which opens a new window and close the current one.) Andrew Poulos
0
10782
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10543
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10213
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9323
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4422
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3078
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.