Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: CSS Buttons and fixed width

    You might also look to the css sliding door code to create a fluid button style.
    Zen-Venom Get Bitten

  2. #2
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: CSS Buttons and fixed width

    Quote Originally Posted by kobra
    You might also look to the css sliding door code to create a fluid button style.
    Interesting :-)

    If that technique works in the Zen Cart case, it will enable us to have cool graphical css buttons, without adding (too much) markup.

  3. #3
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: CSS Buttons and fixed width

    Funny,

    the article I just read about the css sliding door technique might also contain a solution to the automatic width problem.

    In most browsers, floating an element will act sort of like shrink-wrapping it — it gets shrunk to the smallest possible size of the contents it contains. If a floated element contains (or is) an image, the float will shrink to the width of the image. If it contains only text, the float will shrink to the width of the longest non-wrapping line of text.
    I am quite sure I did not try that the time, so it might be a better solution than the current calculated width.

    Source: http://alistapart.com/articles/slidingdoors/

    (under "One Hack for Consistency")

  4. #4
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: CSS Buttons and fixed width

    It works! I removed the width setting

    Not using the float, because of course that did not help setting the input width in IE correctly. IE adds some magic padding to every input which is not over ridable setting the padding using css.

    But it inpired me to look into it further and I found a trick to fix the input width in IE after all.

    It does require a IE specific stylesheet or a a little hack to be added. Both are *very* easy to implement though (maybe the hack is a little easier because IE specific stylesheet probably needs some code changes in the zen core).

    Here is a (temporary!) example online which uses the hack: http://www.beterelektro.nl/test/css-button/index.html

    edit:
    found the idea here: http://www.brownbatterystudios.com/s...x/#comment-196

  5. #5
    Join Date
    Jun 2006
    Posts
    18
    Plugin Contributions
    0

    Default Re: CSS Buttons and fixed width

    I have started to modify css according to sliding door method and til now I succeded with link buttons but input buttons are still messy.. if you see what is wrong there please let me know ;)

    http://www.mozaika.org/index.php?mai...roducts_id=195

  6. #6
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: CSS Buttons and fixed width

    Hi CzechBoy,

    your link css-buttons indeed look great now in Firefox! When I look in IE though the link buttons are as messy as the input buttons (well at least IE seems more consistant in this case ;-) ).

    But I am afraid I can't help you with that right now I do see however that you added the css code which should make the inline css obsolete, but the inline width setting is stil there.

    To remove this inline style you can look for (in includes/html_output.php):
    Code:
    $style = ' style="width: ' . $width . 'px;"';
    And change it to:
    Code:
    $style = ' style="width: ' . $width . 'px;"';
    $style = ''; // remove inline style
    (this way it is easy to revert if needed)

 

 

Similar Threads

  1. CSS Buttons Width Setting
    By PortraitArtist in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Jan 2011, 10:39 PM
  2. Banners width and height fixed
    By jibon in forum Basic Configuration
    Replies: 5
    Last Post: 14 May 2009, 06:53 AM
  3. fixed width page, categories and currencies help
    By nonfinite in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Apr 2009, 08:19 PM
  4. CSS buttons - why is width limited?
    By daymobrew in forum General Questions
    Replies: 2
    Last Post: 4 Apr 2009, 12:49 AM
  5. css buttons width - can't find where to adjust
    By cupcake in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 May 2007, 12:21 PM

Posting Permissions

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