Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Sep 2006
    Location
    North Devon, England, UK
    Posts
    289
    Plugin Contributions
    0

    Default Featured Products - border round product

    Hello

    My site is here: http://www.redwoodsurfshop.co.uk/surfshop/

    You will notice that i have put a border round each product, did this by changing css: 'centerBoxContentsFeatured', I also set the border all round to 2px. This is where the problem starts. Because of this you will notice that the products are starting to overlap the content (logos) on the right, it looks bad and is not what i want it to do, obviously.

    There is plenty of space to add borders, etc. but is behaving badly for some reason.

    I have looked at this file: featured_products.php, to add another div perhaps and format that, but the code is to daunting.

    Can anyone suggest anything?

    Help appreciated.

  2. #2
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Featured Products - border round product

    Please refer to the topic below for more info.
    Borders around products

    .
    A New Starter again

  3. #3
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Featured Products - border round product

    And try to not add paddings to the padding-left and padding-right.

    Code suggestion.
    Code:
    .centerBoxContentsFeatured {
            padding: 1em 0 1em 0;
    	border-top: 0.1em solid #E7E7E7;
    	border-left: 0.1em solid #E7E7E7;
            border-right: 0.1em solid #E7E7E7; 
            border-bottom: 0.1em solid #E7E7E7; 
    	margin-right: -0.1em; /* add more negative value if the cell drop to lower line */
    	margin-left: -0.1em; /* add more negative value if the cell drop to lower line */
            height: 16em; /* adjust according to the maximum height of the product's data */ 
    }
    
    /* For style of the link which under the images of above column display */ 
    .centerBoxContentsFeatured a {
    	display: block; 
    	text-align: center;
    	padding-left: 5%;
    	padding-right: 5%;
    }
    A New Starter again

  4. #4
    Join Date
    Sep 2006
    Location
    North Devon, England, UK
    Posts
    289
    Plugin Contributions
    0

    Default Re: Featured Products - border round product

    Hi seethrou

    Thanks lots, is def what i asked for.

    What css do i tweak to ad space between each box?

    I did tweak the margins but it hasn't made a difference:

    Code:
     
    margin-right: 0.2em; /* add more negative value if the cell drop to lower line */
     margin-left: 0.2em; /* add more negative value if the cell drop to lower line */
    http://www.redwoodsurfshop.co.uk/surfshop/

    Also, there is much space below the top and bottom box rows, it would be good to decrease this, could you let me know which css to change?

  5. #5
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Featured Products - border round product

    Before my last post, I had tested at remote. However I hadn't traced you stylesheet and the page source.
    I only inserted the above codes into the end of the stylesheet in test and it display correctly in my side. And attached screen capture for your reference.

    You missed the negative value.
    Code:
    margin-right: -0.2em; /* add more negative value if the cell drop to lower line */
     margin-left: -0.2em; /* add more negative value if the cell drop to lower line */
    Attached Images Attached Images  
    A New Starter again

  6. #6
    Join Date
    Sep 2006
    Location
    North Devon, England, UK
    Posts
    289
    Plugin Contributions
    0

    Default Re: Featured Products - border round product

    Crikey! - the css is really messy in firefox

  7. #7
    Join Date
    Sep 2006
    Location
    North Devon, England, UK
    Posts
    289
    Plugin Contributions
    0

    Default Re: Featured Products - border round product

    i have now tweaked the margins so they show:

    Code:
     
    margin-right: -0.2em; /* add more negative value if the cell drop to lower line */
     margin-left: -0.2em; /* add more negative value if the cell drop to lower line */
    But the boxes still don't have space inbetween?

    I'm also not sure what this means - "add more negative value if the cell drop to lower line"

  8. #8
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Featured Products - border round product

    Quote Originally Posted by mattys View Post
    I'm also not sure what this means - "add more negative value if the cell drop to lower line"
    It may read as - "If the columnar cell drop to the next line /row under itself, then decrease the cell's width by adding the negative values (less than zero)"

    The above suggestion is only simple adjustments for the columnar display. It only prevent the last display cell in a row from dropping to the next line /row under the row of itself. But seems work for both browsers without extra modifications.

    Quote Originally Posted by mattys View Post
    But the boxes still don't have space inbetween?
    Some points we should noted and to enable us to style it easier and speedup. May be we should look at the code and the css more closely and see how they work.

    The following is page source of my local test, about the Featured Products in the index page and it has 3 cells in row. But I only captured the first row for the demo here.
    HTML Code:
    <div id="featuredProducts" class="centerBoxWrapper">
    <h2 class="centerBoxHeading">Featured Products</h2>
    <div style="width: 33%;" class="centerBoxContentsFeatured centeredContent back">
    <a href="http://localhost/zc136t/index.php?main_page=product_music_info&products_id=169">
    <img width="100" height="80" title=" Sample of Product Music Type " alt="Sample of Product Music Type" src="images/samples/2_small.jpg"/>
    </a>
    <br/>
    <a href="http://localhost/zc136t/index.php?main_page=product_music_info&products_id=169">Sample of Product Music Type</a>
    <br/>
    </div>
    <div style="width: 33%;" class="centerBoxContentsFeatured centeredContent back">
    <a href="http://localhost/zc136t/index.php?main_page=product_info&products_id=12">
    <img width="100" height="80" title=" Die Hard With A Vengeance Linked " alt="Die Hard With A Vengeance Linked" src="images/dvd/die_hard_3.gif"/>
    </a>
    <br/>
    <a href="http://localhost/zc136t/index.php?main_page=product_info&products_id=12">Die Hard With A Vengeance Linked</a>
    <br/>
    </div>
    <div style="width: 33%;" class="centerBoxContentsFeatured centeredContent back">
    <a href="http://localhost/zc136t/index.php?main_page=product_info&products_id=27">
    <img width="100" height="80" title=" Hewlett Packard LaserJet 1100Xi Linked " alt="Hewlett Packard LaserJet 1100Xi Linked" src="images/hewlett_packard/lj1100xi.gif"/>
    </a>
    <br/>
    <a href="http://localhost/zc136t/index.php?main_page=product_info&products_id=27">Hewlett Packard LaserJet 1100Xi Linked</a>
    <br/>
    </div>
    <br class="clearBoth"/>
    And in the form of code collapsed and simplified, they look like:
    HTML Code:
    <div style="width: 33%;" class="centerBoxContentsFeatured centeredContent back">
    <div style="width: 33%;" class="centerBoxContentsFeatured centeredContent back">
    <div style="width: 33%;" class="centerBoxContentsFeatured centeredContent back">
    <br class="clearBoth"/>
    It can find that the width is always 33% for each cells in the row. And this related to setting in admin.
    If set the numbers of cell to display to 2, and the width is 100% /2 = 50%
    If set the numbers of cell to display to 3, and the width is 100% /3 = 33.3%
    If set the numbers of cell to display to 4, and the width is 100% /4 = 25%

    This is the point, the browser will output the width's value first in the html and then later apply the css effect if there is any.

    In above page source, since the width is first fixed at 33%.
    And then if in the css add style to the margin of left and /or right,
    this will add the "overheads" to the widths.
    Because the browser will not turn back again and adjust the width by itself.
    This mean in the output for the row,
    the total width are wider than 100%,
    for:
    ( (33% + "overheads") x 3 ) > 100%

    And in a fixed or limited width situation, this will cause the last cell drop to the next line /row. For there are not sufficent width or space for them to sit inline.

    Therefore while style the columnar display, don't forget the above factors. In each adding of "overheads" to the widths, then in the same time trim off some of the inner width of the cells to provide spaces for the insertion of "overheads".


    And the following is only suggestion and some of them you may not need and can be removed.
    Please note that the width and percentage in below always related to each other, please adjust for yourself.
    Code:
    .centerBoxContentsNew, .centerBoxContentsFeatured, .centerBoxContentsSpecials, .specialsListBoxContents {
    	margin: 1em 0.8em 0 0;
    	padding: 0.5em 0 0.3em 0;
    	border-style: solid; 
    	border-width: 0.1em 0.2em 0.2em 0.1em; /* also add little shadow effect */ 
    	border-color: #CCCCCC #B6B6B6 #B6B6B6 #CCCCCC; /* also add little shadow effect */ 
    	height: 19em; /* adjust according to the maximum height of the product's data */ 
    }
    
    /* Columnar Cell width adjustment */ 
    /* decrease the cell's inner width to provide spaces for the added overhead */
    .centerBoxWrapper div /* #whatsNew div, #featuredProducts div, #specialsDefault div */ {
    	max-width: 30.5%; 
    }
    
    /* Columnar Cell width adjustment */ 
    /* decrease the cell's inner width to provide spaces for the added overhead */
    /* For IE only */
    * html .centerBoxWrapper div {
    	width: auto;
            width: 30.5% !important;	
    }
    
    .centerBoxContentsNew a, .centerBoxContentsFeatured a, .centerBoxContentsSpecials a, .specialsListBoxContents a {
    	display: block;
    	text-align: center;
    	padding-left: 6%;
    	padding-right: 6%;
    }
    
    /* For IE only */
    * html .centerBoxContentsNew a, .centerBoxContentsFeatured a, .centerBoxContentsSpecials a, .specialsListBoxContents a {
    	display: block;
    	text-align: center;
    	padding-left: 3%;
    	padding-right: 3%;
    }
    Hope this helps.
    A New Starter again

  9. #9
    Join Date
    Sep 2006
    Location
    North Devon, England, UK
    Posts
    289
    Plugin Contributions
    0

    Default Re: Featured Products - border round product

    Hi Seethrou

    Once again, thanks for your time.

    I now added the css exactly as you have it above.

    There are still no spaces between boxes and i'm still unsure of how to achieve this?

    Also, the boxes in IE, for the top box especially, are pushing out to to the right side of the page and are not contained, which looks messy.

    However, the dispaly in Fire Fox is much better, although still no spaces (right and left) between boxes still.

    Screenshot FireFox:



    Screenshot IE:



    http://www.redwoodsurfshop.co.uk/surfshop/
    Last edited by mattys; 16 Nov 2006 at 11:25 AM.

  10. #10
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Featured Products - border round product

    I have checked again and the above code still works for my remote test.
    I only inserted my suggested code into the end of your stylesheet, this will override all the previous setting.

    And the following is the screen capture from Firefox, with screen resolution of 1024 x 768.





    With refer to your stylesheet now,
    1. you inserted the suggested code at about line 399

    2. and there is setting in your stylesheet under it at about line 587,
    which in the section of /*list box contents*/.
    And this will affect or override the suggested code at above.

    Code:
    /*list box contents*/
    .centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .additionalImages, .centerBoxContentsSpecials, .centerBoxContentsAlsoPurch, .centerBoxContentsFeatured, .centerBoxContentsNew {
    	margin: 1em 0em;
    	}
    Please check for any conflict between the related sections.
    And check for the provided space is sufficient or not, for they are all relative.
    And in some critical situations, a calculation or chart for each related sections and portions will give better view.
    A New Starter again

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Featured Products Border
    By wallacrj in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 18 Aug 2010, 12:36 AM
  2. CSS How DO I Put a Border Round Special Listings Images?
    By limelites in forum General Questions
    Replies: 2
    Last Post: 10 Jun 2009, 01:30 PM
  3. Add border to Featured Products box
    By mattys in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 1 Jan 2008, 10:59 PM
  4. Adding Border Round Each Listing
    By metalarea in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Oct 2007, 08:31 PM
  5. Border around Featured Product Images
    By guscott in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Aug 2006, 12:44 AM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR