Hi all, I started designing a mobile version for my website. I have amde a start (THis looks hopeless unless you are viewing it through an iPhone, in which it looks perfect http://mobile.silvertails.net However on one of the pages I have a Ladder (this site is a sports site) at the moment I have it with just the team name and their points. I want to add an additional column in the middle for "Played" and I want it to be alligned nicely etc like the rest of the content. Below is the current HTML and CSS http://mobile.silvertails.net/ladder.php HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width = 320" /> <meta name="viewport" content="initial-scale=1, user-scalable=no" /> <title>Silvertails.net iPhone and Mobile Site</title> <link rel="stylesheet" href="RoundRectangle.css" /> </head> <body> <!--Put your headings outside the <ul> tags --> <div class="danbar"> <h1>NRL Ladder - silvertails.net</h1> <a class="button" href="http://mobile.silvertails.net">Home</a> </div> <div class="containdiv"> <!-- Each <ul></ul> pairing represents a group of related options --> <ul> <li><img src="logo.gif" border="0" width="280"></li> <li>Team <span class="secondaryWLink">Points</span></li> <!-- The database line items --> <?php echo $items; ?> </ul> <center>All content copyright silvertails.net 2004 - 2008 ©</center> </div> </body> Code (markup): CSS /* File:RoundRectangle.css Abstract: CSS code for the RoundRectangle sample Version: <1.0> Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (C) 2007 Apple Inc. All Rights Reserved. */ body { margin: 0; padding: 0; background-color: #5a1932;/*rgb(197,204,211); */ /* Set the page color to light blue */ -webkit-text-size-adjust:none; /* Turn off font resizing */ } .containdiv { margin-left: 10px; } .danbar { background: url(toolbar.png) #6d84a2 repeat-x; margin-left: 0px; margin-bottom: 10px; } h1 { margin:0; padding-top:10px; padding-right:10px; padding-bottom:10px; padding-left:10px; font-size:17px; font-family: Helvetica; font-weight:bold; color: rgb(76,86,108); /* Set each label color */ } h2 { margin:0; padding-top:10px; padding-right:0px; padding-bottom:10px; padding-left:0px; font-size:22px; font-family: Helvetica; font-weight:bold; color: rgb(76,86,108); /* Set each label color */ } .button { position: absolute; overflow: hidden; top: 8px; right: 6px; margin: 0; border-width: 0 5px; padding: 0 3px; width: auto; height: 30px; line-height: 30px; font-family: inherit; font-size: 12px; font-weight: bold; color: #FFFFFF; text-shadow: rgba(0, 0, 0, 0.6) 0px -1px 0; text-overflow: ellipsis; text-decoration: none; white-space: nowrap; background: none; -webkit-border-image: url(toolButton.png) 0 5 0 5; } ul { padding: 0; margin-top:0; margin-right:10px; margin-bottom:17px; /* Set each list 17 pixels from the top of the button bar(or the top of the next list) */ font-size:17px; font-family: Helvetica; font-weight:bold; color:black; width: 300px; background-color: white; /* Each list has a white background fill */ border-width: 1px; /* Draw a rectangle around each list */ border-style:solid ; border-color:rgb(217,217,217); -webkit-border-radius: 8px; /* Round each corner of the created rectangle */ } li { list-style-type: none; border-top-width:1px; /* Create lines between cells. Each line is placed above each item */ border-top-style:solid; border-top-color:rgb(217,217,217); padding-top:10px; padding-right:10px; padding-bottom:14px; /* Indent the cell content 14 pixels from the bottom edge of a cell */ padding-left:10px; } li:first-child { border-top:0; /* Remove border above the first item of the list */ } a /* Handle the click/tap highlight. Highlight an entire cell with the iPhone grey background when tapped */ { display: block; /* Sets the href to be a block rather than inline */ /* The padding properties adjust the text content within the href block */ padding-top: 8px; padding-right: 8px; padding-bottom: 12px; padding-left: 8px; /* The margin properties adjust the size of the href block */ margin-top: -8px; margin-right: -8px; margin-bottom: -12px; margin-left: -8px; text-decoration: none; color:black; } .bblock /* Handle the click/tap highlight. Highlight an entire cell with the iPhone grey background when tapped */ { display: block; font-weight:normal; width: 20px; padding-right: 10px; position: absolute; } .showArrow /* Add an arrow button to a link */ { margin-right:10px; padding-right:16px; /* Distance between the arrow button and a text */ background-image: url(images/chevron.png); background-repeat: no-repeat; background-position: right; } .secondary /* Used for secondary text (text that is less important) */ { font-weight:normal; /* Regular font is used for secondary text */ float:right; /* Align secondary text to the right of its parent cell */ margin-right:10px; } .secondaryWArrow /* Used for secondary content that contains a link and a button */ { display:block; /* Set the secondary content to be a block */ font-weight:normal; float:right; color: #324F85; /* sets the color of the link */ } .secondaryWLink2 /* Used for secondary text that is a link */ { font-weight:normal; float:right; margin-right:30px; color: #EEEEEE; /* sets the color of the link */ } .secondaryWLink /* Used for secondary text that is a link */ { font-weight:normal; float:right; margin-right:10px; color: #324F85; /* sets the color of the link */ } Code (markup): Does anyone have an idea how I can achieve this? CHeers Dan
<li> <span class="secondaryWLink">Warriors</span> 20 </li> ============ li { /*RoundRec...angle.css (line 144)*/ border-top:1px solid #D9D9D9; list-style-type:none; overflow:hidden; padding:10px 10px 14px; text-align:right; } .secondaryWLink { /*RoundRec...angle.css (line 231)*/ color:#324F85; float:left; font-weight:normal; margin-right:10px; } Code (markup): The floated item must precede the static. Also, give the li its own block formatting context (the overflow property did that). cheers, gary
Yeah, but it showed the approach to take. See this test case: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title></title> <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="editor" content="Emacs 21" /> <meta name="author" content="Gary Turner" /> <style type="text/css"> /*<![CDATA[*/ ul { border: 2px solid #aaa; margin: 0; padding: 0; list-style: none; width: 280px; } li { border-bottom: 1px solid #ddd; overflow: hidden; padding: 1em 0; padding-left: 5px; } li:last-child { border: none; } li span.team { float: left; width: 45%; } li span.points { float: right; width: 10%; } /*]]>*/ </style> </head> <body> <ul> <li><span class="team">bullfrogs</span><span class= "points">20</span>mayflies</li> <li><span class="team">bullfrogs</span><span class= "points">20</span>mayflies</li> <li><span class="team">bullfrogs</span><span class= "points">20</span>mayflies</li> </ul> </body> </html> Code (markup): You might want to consider a table for this. Either of list or table would be ok semantically and structurally, but I'd give table a slight edge. Use whichever works best for you. cheers, gary