deansaddigh Posted November 9, 2009 Share Posted November 9, 2009 For some reason my Wrapper isnt holding my hold page, i must have forgot a closing div. Can someone just look at the code and see what you think. <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="../css/layout.css" /> <link rel="stylesheet" href="../css/lightbox.css" type="text/css" media="screen" /> <script type="text/javascript" src="../js/prototype.js"></script> <script type="text/javascript" src="../js/scriptaculous.js?load=effects,builder"></script> <script type="text/javascript" src="../js/lightbox.js"></script> <title>Nextdayfrags.co.uk</title> </head> <body> <!--wrapper to hold site--> <div id="wrapper"> <!--Logo holder--> <div id="header"> </div> <div id="left"> <div class="nav"> <a href="#">View Cart</a> <a href="#">Clear Cart</a> </div> </div> <div id="right"> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it?</p> <?php require_once '../functions/functions.php'; $output =' <table class ="products"> <tr>'; foreach(get_xml_cataloge() as $product) { $output .= ' <td> <h2>'. $product->title .'</h2> <div> <a href="'. $product->img .'" rel="lightbox"><img src="'. $product->img .'" height="100" width="100" /></a> </div> <div>'. $product->description .'</div> <div class="price"> '. $product->price .' </div> <div class="addtocart"> <a href="#">add to Cart</a> </div> </td>'; } $output .=' </tr> </table>'; echo $output; ?> </div> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
ram4nd Posted November 9, 2009 Share Posted November 9, 2009 not about closing div, van you show the page in some hosting? Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted November 9, 2009 Author Share Posted November 9, 2009 Hi, Heres the link http://www.deansaddigh.centelia.net/Php%20Shoping%20cart/html/ ive coloured in the wrapper green for visibility Quote Link to comment Share on other sites More sharing options...
haku Posted November 10, 2009 Share Posted November 10, 2009 It's because wrappers don't automatically expand to contain floated elements. Add this to the wrapper to make it contain the elements: overflow:auto; One thing you should know though, your site looks garbage on a widescreen monitor. The background image only extends about 2/3 the way across the screen, and the right 1/3 is just white. But your contents inside the wrapper sit in the middle of the screen. It's all messed up. Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted November 10, 2009 Author Share Posted November 10, 2009 Thanks for your help, what should i do with regards to that background image, because i really want to use it Quote Link to comment Share on other sites More sharing options...
gevans Posted November 10, 2009 Share Posted November 10, 2009 You could repeat it, but that would look pretty back. Not a fan of background images in general (on the body). Some textures can pull it off... Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted November 10, 2009 Author Share Posted November 10, 2009 Cheers for the advice. how do they do it on these sites though they all have detailed images as backgrounds, im just trying to make my site aesthetically pleasing. http://www.noupe.com/design/63-impressive-website-background-images-trends-resources-and-tutorials.html Quote Link to comment Share on other sites More sharing options...
gevans Posted November 10, 2009 Share Posted November 10, 2009 If you look at the first site in that list; 1. the background only snaps the horizontal, the vertical is not important. 2. http://www.viget.com/images/extend/outer_wrapper_bg.jpg - that's the background image. It's just repeated on the x axis. Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted November 10, 2009 Author Share Posted November 10, 2009 Cheers for the advice is there anyway i can do that with my image, sorry for the questions, just trying to get an understand Quote Link to comment Share on other sites More sharing options...
gevans Posted November 10, 2009 Share Posted November 10, 2009 As I emntioned in my first reply you can repeat your image. But it isn't a 'repeatable image' as the link above is. You could look for some different images/banners to use in place of yours. Have it fade out to a solid colour that you can set your background to. Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted November 10, 2009 Author Share Posted November 10, 2009 oh i see but how would i stop white spaces horizontally? (say if they are using a wide screen Quote Link to comment Share on other sites More sharing options...
gevans Posted November 10, 2009 Share Posted November 10, 2009 That would depend on your image. If the sides of the image fade to a solid colour you can set that colour as your background-color. If you get an image that will repeat nicely on the x-axis you can set background-repeat to repeat-x. Or the option I wouldn't go for, you can get a massive image (I really wouldn't do that). Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted November 10, 2009 Author Share Posted November 10, 2009 Got it, thanks soo much ill do it and put it up so you can see. Thanks again Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted November 10, 2009 Author Share Posted November 10, 2009 Ok, i have done as advised hopefully i have got it right, if possible could you take a look. http://www.deansaddigh.centelia.net/Php%20Shoping%20cart/html/ I basically did what you said made an image fade it to a solid colour and used a background colour that blends. Quote Link to comment Share on other sites More sharing options...
gevans Posted November 10, 2009 Share Posted November 10, 2009 That's def better than it was!! Try the following; replace background-image:url(../images/pagebg.jpg); background-attachment:fixed; background-repeat :no-repeat; background-color: #1372ce; with background-image: url(../images/pagebg.jpg) no-repeat fixed center top #1372ce That's the shorthand for everything you've written. And I've positioned the image at the center top position! Quote Link to comment Share on other sites More sharing options...
gevans Posted November 10, 2009 Share Posted November 10, 2009 You might also be tempted to drop the 2px border around your main div! Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted November 10, 2009 Author Share Posted November 10, 2009 Thanks very much for all your help i really appreciate it, ive changed the code to your version. Thanks again Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted November 10, 2009 Author Share Posted November 10, 2009 Thanks for all your help. i have changed the code as specified. Thanks again i now understand the principles of background images and realise what a big mistake i made Quote Link to comment Share on other sites More sharing options...
gevans Posted November 10, 2009 Share Posted November 10, 2009 No worries, hit the 'SOLVED' button Quote Link to comment Share on other sites More sharing options...
haku Posted November 11, 2009 Share Posted November 11, 2009 Still got a problem. It looks fine at the top, but your background image repeats along the y-axis now, so you get a repeat further down the page. It looks messed up. But overall it looks better than originally. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.