June 12, 201016 yr Hey. Iv been developin a site. but im having problems aligning my sidebar text into the sidebar. along with my content area's ob the right. Iv tried everything but its doing my head in now so i feel no other option is available other than to seek advice from the pro's. Here is my home.css #wrapper { width: 1024px; height: 1000px; background-image: url('../images/home_theme.png'); margin: auto; color: #FFFFFF; } a:link {color: #FFFFFF;} a:visited {color: #FFFFFF;} a:hover {color: #00FFFF;} #header { width: 413px; height: 20px; margin-top: 16px; float: right; text-align: center; font-weight: bolder; } #content_head { width: 650px; height: 115px; float: right; clear: both; margin-top: 114px; margin-right: 32px; } #content { height: 337px; width: 621px; float: right; margin-right: 47px; margin-top: 250px; } #sidebar_text { height: 338px; width: 301px; clear: right; margin-left: 21px; float:left; } and here is my index.html <!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" xml:lang="en" lang="en"> <head> <title>Home</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <style type="text/css"> body { background-image:url('images/website_background.png'); background-repeat: repeat; } </style> <link / rel="stylesheet" href="css/home.css" type="text/css" media="screen"> </head> <body> <div id="wrapper"> <div id="header">Tel: 01782 818097 | Email: <a href="mailto:support@andys-motorcycles.com" title="email_andys_motorcycles">support@andys-motorcycles.com</a></div> <div id="content_head"><h1 align="center">Motorcycle, scooter & motocross spare parts & accessories available to order online now.</h1></div> <div id="content"><p>Do you need to buy motorbike, scooter or motocross parts fast? If so then you're in the right place. With over 30 years experience in the bike trade we are able to quickly and easily deal with any problems our customers may encounter with their bikes. With full workshop facilities & experienced mechanics on site, any mechanical or electrical repair is swiftly dealt with avoiding high garage costs that many other dealers will charge. A Local recovery service is also in operation during normal business hours for breakdown recoveries across the Stoke on Trent area.<p> <p>In stock: Piston kits, Tyres, Clutch Plates & Springs, Inner Tubes, Gaskets, Oil, Indicators, Bulbs, Seals, Filters, Reeds, Levers, Cables, Brake Pads & Shoes, Performance Parts, Ignition Coils, Brake Discs, Exhausts, CDI Units, Grips, Stickers, Cosmetics, Headlights, Handlebars, Stainless Hoses, Drive Chains & Belts, Sprockets, Generators and much, much more...<p> <p>Head on over to our fully operational online store where you can browse for the parts you require and make an immediate purchase. We send all orders made before 2pm out on the same working day and aim to get orders with their customers within 3 working days. Do not worry if you cannot find the parts you require online as we have far too much stock to list and will still be able to help. Get in touch with us and one of our staff will be more than happy to supply you with what you are looking for.<p> </div> <div id="sidebar_text"><p>We stock spare parts and accessories for most major Japanese, Italian, French, Spanish and even Chinese motorcycle and scooter brands.<p> <p>Aprilia, Derbi, Baotian, Gilera, Kawasaki, Superbyke, Yamaha, Piaggio, Suzuki, Peugeot, Honda, PGO, KTM, Haotian, Skyjet, Malaguti, CPI, Cagiva, Mini Moto's & Pit Bikes are just some of the makes & models we stock spares for.</p><p>Established at our store in Stoke-on-Trent for over 30 years we have the best local stock of new and used spares for a wide variety of bikes & scooters. For enquiries on how to buy used parts contact the shop during business hours on 01782 818097.</p> <div id="adsense"><script type="text/javascript"> google_ad_client = "pub-5431799335873325"; google_ad_slot = "1322372698"; google_ad_width = 300; google_ad_height = 250; </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></div> </div> </body> </html> My visual preview on my html editor shows everything lined up absolutely perfectly however when I view within a browser the sidebar text and sidebar adsense ad shows under my main content text but floated to the right. Iv recently converted from Dreamweaver wysiwyg to raw html coding do please be patient with me as this is my first web project ever by hand. Thank you.
June 12, 201016 yr Hey. Iv been developin a site. but im having problems aligning my sidebar text into the sidebar. along with my content area's ob the right. Iv tried everything but its doing my head in now so i feel no other option is available other than to seek advice from the pro's. Here is my home.css #wrapper { width: 1024px; height: 1000px; background-image: url('../images/home_theme.png'); margin: auto; color: #FFFFFF; } a:link {color: #FFFFFF;} a:visited {color: #FFFFFF;} a:hover {color: #00FFFF;} #header { width: 413px; height: 20px; margin-top: 16px; float: right; text-align: center; font-weight: bolder; } #content_head { width: 650px; height: 115px; float: right; clear: both; margin-top: 114px; margin-right: 32px; } #content { height: 337px; width: 621px; float: right; margin-right: 47px; margin-top: 250px; } #sidebar_text { height: 338px; width: 301px; clear: right; margin-left: 21px; float:left; } and here is my index.html <!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" xml:lang="en" lang="en"> <head> <title>Home</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <style type="text/css"> body { background-image:url('images/website_background.png'); background-repeat: repeat; } </style> <link / rel="stylesheet" href="css/home.css" type="text/css" media="screen"> </head> <body> <div id="wrapper"> <div id="header">Tel: 01782 818097 | Email: <a href="mailto:support@andys-motorcycles.com" title="email_andys_motorcycles">support@andys-motorcycles.com</a></div> <div id="content_head"><h1 align="center">Motorcycle, scooter & motocross spare parts & accessories available to order online now.</h1></div> <div id="content"><p>Do you need to buy motorbike, scooter or motocross parts fast? If so then you're in the right place. With over 30 years experience in the bike trade we are able to quickly and easily deal with any problems our customers may encounter with their bikes. With full workshop facilities & experienced mechanics on site, any mechanical or electrical repair is swiftly dealt with avoiding high garage costs that many other dealers will charge. A Local recovery service is also in operation during normal business hours for breakdown recoveries across the Stoke on Trent area.<p> <p>In stock: Piston kits, Tyres, Clutch Plates & Springs, Inner Tubes, Gaskets, Oil, Indicators, Bulbs, Seals, Filters, Reeds, Levers, Cables, Brake Pads & Shoes, Performance Parts, Ignition Coils, Brake Discs, Exhausts, CDI Units, Grips, Stickers, Cosmetics, Headlights, Handlebars, Stainless Hoses, Drive Chains & Belts, Sprockets, Generators and much, much more...<p> <p>Head on over to our fully operational online store where you can browse for the parts you require and make an immediate purchase. We send all orders made before 2pm out on the same working day and aim to get orders with their customers within 3 working days. Do not worry if you cannot find the parts you require online as we have far too much stock to list and will still be able to help. Get in touch with us and one of our staff will be more than happy to supply you with what you are looking for.<p> </div> <div id="sidebar_text"><p>We stock spare parts and accessories for most major Japanese, Italian, French, Spanish and even Chinese motorcycle and scooter brands.<p> <p>Aprilia, Derbi, Baotian, Gilera, Kawasaki, Superbyke, Yamaha, Piaggio, Suzuki, Peugeot, Honda, PGO, KTM, Haotian, Skyjet, Malaguti, CPI, Cagiva, Mini Moto's & Pit Bikes are just some of the makes & models we stock spares for.</p><p>Established at our store in Stoke-on-Trent for over 30 years we have the best local stock of new and used spares for a wide variety of bikes & scooters. For enquiries on how to buy used parts contact the shop during business hours on 01782 818097.</p> <div id="adsense"><script type="text/javascript"> google_ad_client = "pub-5431799335873325"; google_ad_slot = "1322372698"; google_ad_width = 300; google_ad_height = 250; </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></div> </div> </body> </html> My visual preview on my html editor shows everything lined up absolutely perfectly however when I view within a browser the sidebar text and sidebar adsense ad shows under my main content text but floated to the right. Iv recently converted from Dreamweaver wysiwyg to raw html coding do please be patient with me as this is my first web project ever by hand. Thank you. add this to your css .clear{clear:both;} and add this <div class="clear"></div> to ur html i have already added it u can copy paste the 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" xml:lang="en" lang="en"> <head> <title>Home</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <style type="text/css"> body { background-image:url('images/website_background.png'); background-repeat: repeat; } </style> <link / rel="stylesheet" href="css/home.css" type="text/css" media="screen"> </head> <body> <div id="wrapper"> <div id="header">Tel: 01782 818097 | Email: <a href="mailto:support@andys-motorcycles.com" title="email_andys_motorcycles">support@andys-motorcycles.com</a></div> <div id="content_head"><h1 align="center">Motorcycle, scooter & motocross spare parts & accessories available to order online now.</h1></div> <div id="content"><p>Do you need to buy motorbike, scooter or motocross parts fast? If so then you're in the right place. With over 30 years experience in the bike trade we are able to quickly and easily deal with any problems our customers may encounter with their bikes. With full workshop facilities & experienced mechanics on site, any mechanical or electrical repair is swiftly dealt with avoiding high garage costs that many other dealers will charge. A Local recovery service is also in operation during normal business hours for breakdown recoveries across the Stoke on Trent area.<p> <p>In stock: Piston kits, Tyres, Clutch Plates & Springs, Inner Tubes, Gaskets, Oil, Indicators, Bulbs, Seals, Filters, Reeds, Levers, Cables, Brake Pads & Shoes, Performance Parts, Ignition Coils, Brake Discs, Exhausts, CDI Units, Grips, Stickers, Cosmetics, Headlights, Handlebars, Stainless Hoses, Drive Chains & Belts, Sprockets, Generators and much, much more...<p> <p>Head on over to our fully operational online store where you can browse for the parts you require and make an immediate purchase. We send all orders made before 2pm out on the same working day and aim to get orders with their customers within 3 working days. Do not worry if you cannot find the parts you require online as we have far too much stock to list and will still be able to help. Get in touch with us and one of our staff will be more than happy to supply you with what you are looking for.<p> </div> <div class="clear"></div> <div id="sidebar_text"><p>We stock spare parts and accessories for most major Japanese, Italian, French, Spanish and even Chinese motorcycle and scooter brands.<p> <p>Aprilia, Derbi, Baotian, Gilera, Kawasaki, Superbyke, Yamaha, Piaggio, Suzuki, Peugeot, Honda, PGO, KTM, Haotian, Skyjet, Malaguti, CPI, Cagiva, Mini Moto's & Pit Bikes are just some of the makes & models we stock spares for.</p><p>Established at our store in Stoke-on-Trent for over 30 years we have the best local stock of new and used spares for a wide variety of bikes & scooters. For enquiries on how to buy used parts contact the shop during business hours on 01782 818097.</p> <div id="adsense"><script type="text/javascript"> google_ad_client = "pub-5431799335873325"; google_ad_slot = "1322372698"; google_ad_width = 300; google_ad_height = 250; </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></div> </div> </body> </html> Clear both tutorial
June 12, 201016 yr Author You code you have supplied makes no change whatsoever when viewed in a browser and also the visual view on my editor also is wrong now whereas using the code i provided before it was okay in the preview but no good in the browser. I think that the fault is actually with one of the other css rules. Im gonna take another look
Create an account or sign in to comment