Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2006, 03:37 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Float causing background-color not to show

I'm trying to create a box with curved corners, but without using tables.

here's the code:
<div style="width:769px;background-color:#000000;padding-top:20px; color:#000000;"><img src="images/ad_banner.gif" width="558" height="69" alt="" class="centeredAd" /><img src="images/ele_btmLeftCorn_black.gif" width="6" height="8" alt="" style="float:left" /><img src="images/ele_btmRightCorn_black.gif" width="6" height="8" alt="" style="float:right" /></div>

the code is working except that between the 2 corner images (ele_btmLeftCorn_black.gif & ele_btmRightCorn_black.gif) the background-color is not being used: instead of black it's white. I know i could either use a table or just make one image that has both corners on it, but i'd rather use my 2 small images and no tables.

thanks,
Josh
 
Old January 10th, 2006, 03:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Got a URL to a working example?

--
http://yupapa.com
 
Old January 10th, 2006, 04:44 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by meow
 Got a URL to a working example?
unfortunately it's in a protected workspace. i think i'm just going to use one image instead of 2. thanks!



 
Old January 24th, 2006, 07:29 AM
Registered User
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I would suggest using 2 images. Otherwise you will not be able to assign the block dynamic width (%).

Rather than using float to make the images stick to the left or to the right, use position. By positioning the block itself relatively (left:0px; top:0px;) you create the possibility of positioning the corners with absolute positioning. You will need to put the images inside the div block for this to work. The top left corner should be positioned left: -1px and top: -1px, asuming that the block has a border of one pixel. The right corner should be positioned right: -1px and top: -1px. This should work for you.

Happy programming!

/J Andersson





Similar Threads
Thread Thread Starter Forum Replies Last Post
change color of background meena88 C# 2005 3 December 1st, 2009 04:48 AM
Background Color matrix ArnieStewart BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 3 October 21st, 2008 01:12 AM
mdi-background color avats General .NET 1 February 28th, 2008 10:25 AM
background-color disappears harpua CSS Cascading Style Sheets 1 August 19th, 2005 04:53 PM
acformreadonly causing subforms to not show Loralee Access 8 December 5th, 2004 12:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.