Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    Aug 2009
    Posts
    402
    Thanks
    118
    Thanked 0 Times in 0 Posts

    Problem with UL specs

    i'm trying to get the list items in the middle of this page (http://www.mayhempoolcues.com/index1.html) to line up just like that do in the current page which used the old table methodology seen here: http://www.mayhempoolcues.com/. obviously i'm going about it all wrong. can anyone please steer me in the right direction?

    thanks!

    Code:
    }
    #thumb {
    	margin: 0px;
    	padding: 0px;
    
    	width: 800px;
    }
    #thumb ul {
    	margin: 0px;
    	padding: 0px;
    	width: 600px;
    }
    #thumb ul li {
    	padding: 50px;
    	margin: 0px;
    	float: left;
    	width: 300px;
    	height: 200px;
    	list-style-type: none;
    	display: inline-block;
    	vertical-align: top;
    	color: #000000;
    	font-size: 12px;
    
    }
    #thumb ul li a {
    	color: #FFFFFF;
    }
    #thumb ul li a:visited {
    	color: #FFFFFF;
    }
    #thumb ul li a:hover {
    	color: #F92325;
    }
    #thumb ul li a img {
    	border: none;
    	display: block;	
    }
    #thumb ul li a:hover img {
    	border-color: #F92325;
    }
    #thumb ul li img {
    	width: 300px;
    }

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,672
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Have you considered a definition list instead of a ul?

    Have a quick look at this -
    CSS:
    Code:
    @charset "utf-8";
    body {
    	margin: 0px auto;
    	padding: 0px;
    	background-image: url(pics/template/back_cross2.jpg);
    	background-repeat: repeat-y;
    	background-position: center;
    }
    *{margin:0;padding:0;border:none;}
    dl {
    text-align: center;
    }
    dt, dd, dd img {
    width: 350px}
    dt {
    }
    dd a {
    color: #fff;
    }
    h1 {
    	font-size: 24px;
    	color: #FFFFFF;
    	margin: 0px;
    	padding: 0px;
    }
    h2 {
    	font-size: 16px;
    	color: #FFFFFF;
    Markup:
    Code:
        <h1 align="center"><b>Mayhem Branded Products</b><br>
        </h1>
    
      <div id="thumb">
    <dl>
    <dt>Logo Pool Cue - SKUMAY01</dt>
    <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
    <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
    <dt>Logo Pool Cue - SKUMAY01</dt>
    <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
    <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
    <dt>Logo Pool Cue - SKUMAY01</dt>
    <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
    <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
    <dt>Logo Pool Cue - SKUMAY01</dt>
    <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
    <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
    <dt>Logo Pool Cue - SKUMAY01</dt>
    <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
    <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
    <dt>Logo Pool Cue - SKUMAY01</dt>
    <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
    <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
    </dl>
        <ul>
    	  <li><a href="product_pages/mayhem_logo.html">Logo Pool Cue - SKU MAY01<img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></li>
    	  <li><a href="product_pages/mayhem_logo.html">Logo Pool Cue - SKU MAY01<img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></li>
    	  <li><a href="product_pages/mayhem_logo.html">Logo Pool Cue - SKU MAY01<img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></li>
    	  <li><a href="product_pages/mayhem_logo.html">Logo Pool Cue - SKU MAY01<img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></li>
        </ul>

    Here is a demo I have on styling a dl. Also shows an easy 2 column layout for it that you will need - http://nopeople.com/CSS/dl/another_dl.html
    Last edited by Excavator; 11-01-2009 at 11:55 PM.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Regular Coder
    Join Date
    Aug 2009
    Posts
    402
    Thanks
    118
    Thanked 0 Times in 0 Posts
    thanks. a definition list is new territory for me. i'll use it if necessary but it looks like there's more html code that in an unordered list. i'm revising this site in order to make it more search engine friendly so if anything i'm trying to streamline and reduce the html code.

    that being said is there a simpler way to achieve the same goal with a UL???? i'm sort of close to the desired effect right now.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,672
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    I have to disagree. It is only adding one more tag that you can style.
    Unordered list has ul and li.
    Definition list has dl, dt and dd.

    The title (dt) tag saves you putting a class on every li that has your product title. If anything, that reduces the size of your code.
    See <li class="whatever">product title</li> or <li><span>product title</span></li>

    or <dt>product title</dt>

    http://www.w3schools.com/TAGS/tag_dl.asp
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    Regular Coder
    Join Date
    Aug 2009
    Posts
    402
    Thanks
    118
    Thanked 0 Times in 0 Posts
    thanks.

    so i put the code in there and tweaked it a little to try and get everything to center. but i cant get the product headings (i.e. Logo Pool Cue - SKUMAY01) to center align like everything else. any advice?


    here's the current code i have in place:
    Code:
    *{
    	margin: 0px;
    	padding: 0px;
    	border: none;
    }
    dl {
    	text-align: center;
    }
    dt, dd img {
    	width: 350px;
    
    }
    dd {
    	height: 50px;
    }
    dd a {
    	color: #fff;
    }

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,672
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    It looks like it is centered... do this to check real quick:
    Code:
    dt, dd img {
    	width: 350px;
    background: #00f;
    
    }
    If you apply the width to the dl instead of the dt it should work better.


    Code:
    *{
    	margin: 0px;
    	padding: 0px;
    	border: none;
    }
    dl.one {
    	text-align: center;
    	width: 350px;
    margin: 0 0 0 20px;
    float: left;
    }
    dl.two {
    	text-align: center;
    	width: 350px;
    margin: 0 20px 0 0;
    float: right;
    }
    dt, dd img {
    background: #00f;
    
    }
    dd {
    	height: 50px;
    }
    dd a {
    	color: #fff;
    }
    h1 {
    	font-size: 24px;
    	color: #FFFFFF;
    	margin: 0px;
    	padding: 0px;
    }
    h2 {
    	font-size: 16px;
    	color: #FFFFFF;
    	margin: 0px;
    	padding: 0px;
    }
    #wrapper {
    margin: 0 auto;
    overflow: auto;
    	width: 1000px;
    }
    #banner {
    	background-image: url(pics/template/banner.jpg);
    	background-repeat: no-repeat;
    	background-position: left top;
    and
    Code:
        <h1 align="center"><b>Mayhem Branded Products</b><br>
        </h1>
    
      <div id="thumb">
        <p>&nbsp;</p> 
        <dl class="one">
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
        </dl>
        <dl class="two">
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
           <dt>Logo Pool Cue - SKUMAY01</dt>
           <dd><a href="product_pages/mayhem_logo.html"><img src="pics/products/logo_sml.jpg" alt="logo pool cue"></a></dd>
           <dd><a href="product_pages/mayhem_logo.html">Click here for details</a></dd>
        </dl>
      </div><!-- end thumb div -->
    
        <!-- InstanceEndEditable --></div>
      <div id="bottom_nav">
          <ul>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #7
    Regular Coder
    Join Date
    Aug 2009
    Posts
    402
    Thanks
    118
    Thanked 0 Times in 0 Posts
    ok. making some progress and i'm understanding a little better how these lists work. but the alignment is still a little off as you can tell: http://www.mayhempoolcues.com/index1.html

    and i can't figure out how to make the final adjustments so everything lines up properly. please advise. thanks!

  • #8
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,672
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Your product image is 439x74. You should really resize the image itself if possible.

    This works too:

    Code:
    dd img {
    	width: 350px;
    }
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    sixrfan (11-02-2009)

  • #9
    Regular Coder
    Join Date
    Aug 2009
    Posts
    402
    Thanks
    118
    Thanked 0 Times in 0 Posts
    you're a genious. thank you.

    while we're on the topic of cleaning up the code on this page, below is the code that begins the template that i apply to all the other pages of the site.

    i'm concerned that the order of all the messages in here is completely out of whack. for instance, i don't know why all these types of message are where they are.

    Code:
    <!-- TemplateEndEditable -->
    <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
    should they be where they are? thanks.




    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
    
    <script type="text/javascript">
    <!--
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    <link href="../www/mayhempoolcues.com/mayhem.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body onload="MM_preloadImages('../www/mayhempoolcues.com/pics/template/over_home.jpg','../www/mayhempoolcues.com/pics/template/over_maintenance.jpg','../www/mayhempoolcues.com/pics/template/over_warranty.jpg','../www/mayhempoolcues.com/pics/template/over_links.jpg','../www/mayhempoolcues.com/pics/template/over_contact.jpg')">
    <div id="wrapper">

  • #10
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,672
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    "while we're on the topic of cleaning up the code on this page"

    You still have floats that are not cleared. In both #wrapper and #thumb.
    Adding overflow:auto; to those elements will clear their floats.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #11
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,672
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    The template begin/end stuff is what makes your template editable. If you're editing it in a text editor you can change whatever you want but if you're working on your site in DreamWeaver, the template tags keep people from editing things they should stay away from.
    You would want your #thumbs to be editable so you would have that wrapped inside the TemplateBeginEditable tags...
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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