Results 1 to 3 of 3

Thread: http://www.dynamicdrive.com/dynamicindex1/droptabmenu.htm

  1. #1
    Join Date
    Jan 2011
    Location
    Queensland, Australia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default http://www.dynamicdrive.com/dynamicindex1/droptabmenu.htm

    1) Script Title: Drop down tabs (5 styles)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...roptabmenu.htm

    3) Describe problem: I am using tab style #4. Auto resize of tab background to fit font size.

    I have most of the finer points sorted now, exept for one.
    How do I stop the back ground image of the tab resizing to fit to the size of the font size?
    Changing the font size in the css file also resizes the background image to 'fit' the font.
    I don't want this to happen as my layout is within a table and I want to have a corresponding image (a tab looking image) in one column to line up with the menu in another column.
    I would like that the image I have created for the background tabs, stays put with the font centred in the middle.
    test page up at so you can see what I mean. http://www.oloughlin.id.au/test/index2.htm
    Thanks
    Jan
    Last edited by Jano; 01-17-2011 at 07:50 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This may or may not be exactly the answer you're looking for, as the tabs don't actually "resize". That is to say, like many elements on a web page, they simply are the size they are as dictated by the amount of space required by their content. The background doesn't change size, but the area through which the background is seen does.

    I suppose that's potentially governed by various things. I instinctively went for the .glowingtabs a span selector's padding (in the menu.css file - highlighted line, changes red):

    Code:
    .glowingtabs a span{
    float:left;
    display:block;
    background:url(images/glowtab.jpg) no-repeat right top;
    padding: 6px 14px 4px 5px;
    font-weight:bold;
    color:#3B3B3B;
    }
    Those are the top, right, bottom, and left padding values respectively. The above values looked right to me for a 12px Verdana font. If you use a different font, things may change. If you use a different font size, they definitely will.

    BTW, the font should have backup:

    Code:
    .glowingtabs{
    	color:#FFFFFF;
    	float:left;
    	width:100%;
    	font:normal 12px Verdana, arial, sans-serif;
    	border-bottom: 4px solid #4c6c49;
    	text-decoration: none;
    }
    Otherwise, if Verdana is unavailable in a given browser, you likely will get a serif font like Times New Roman, which is not only ugly there, but also has a different size, such that it would throw off the alignment.
    Last edited by jscheuer1; 01-17-2011 at 05:40 PM. Reason: English usage
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2011
    Location
    Queensland, Australia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Many thanks John
    Your solution has fixed my 'problem' and it doesn't look so squashed now as before. Looks infinitely better I would say.
    And also for the tips on the font. In the words of Monty Python - Life of Brian "What did the Romans ever do for us?"
    cheers
    Jan

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •