CSS - Element Bg Background Position Not Working...
*** After posting I have been playing with other options, but would still love to know why the bg position on .container_12 does not work.
Please look at this page http://www.mts-diesel.com/index.php?cPath=20_24_56 There is an element w/ an class of container_12 that I have put an inline style declaration of style="background:transparent url(images/container_12_bg.jpg) 0 1000px !important;" I am trying to push the background down below the navigation but for some reason I can only move the background image to the right, and not down as needed. Thank you for any help. Tom Similar TutorialsHey Guys! Trying to add a background position to a div and position it top right. Works in FF and IE7, but IE6 wants to put it top left. Code: background: $hexcolor url(/v2/PHP/img/$logo) no-repeat top right; www.RoundtopRiders.com/v2/videos/ Thank you in advance! I'm trying to create a tiered vertical navigation menu and I'm nearly there. Everything works correctly in FF but in IE the background-position property on the current menu item fails to position the bullet image. Removing the property displays it but at the margin which is set to 0px. I'm not that savvy with CSS so if there's a better approach to this I'm open to suggestions. Thanks for your help! Open in FF to see how it's supposed to work: Open in IE to see problem. Here's the HTML Code: <div id="Menu"> <div id="nav_header"> <div id="text"> Admissions & Financial Aid </div> </div> <ul id="nav_level_1"> <li id="submenu"><a href="../index.php">Applying to Union</a></li> <ul id="nav_level_2"> <li id="nav_active"><a href="index.php">Types of Admission</a></li> <ul id="nav_level_3"> <li><a href="Transfer.php">Transferring to Union</a></li> <li><a href="Early.php">Early Decission</a></li> <li><a href="Regular.php">Regular</a></li> <li><a href="international.php">International Admission</a></li> <li><a href="aop_heop.php">AOP/HEOP</a></li> <li><a href="Medical.php">Eight-year Medical</a></li> <li><a href="Law.php">Six-year Law</a></li> <li><a href="MBA.php">Five-year MBA</a></li> <li style="line-height:0px;font-size:0px;">*</li> </ul> <li><a href="../Applications.php">Apply Online</a></li> <li><a href="../Forms/index.php">Download Application Materials</a></li> <li style="line-height:0px;font-size:0px;">*</li> </ul> <li><a href="../../FAQs/index.php">Have a Question?</a></li> <li><a href="../../Financial_Aid/index.php">Financial Aid</a></li> <li><a href="../../Events/index.php">Events/Programs & Visiting</a></li> <li><a href="../../interviews.php">Interviews</a></li> <li><a href="../../PerfectSchool/index.php">Tips for College Search</a></li> <li><a href="../../About/index.php">Admissions Staff</a></li> <li><a href="../../AlumniAdmissions/index.php"></a></li> <li><a href="../../Media/index.php"></a></li> <li><a href="/union/admissions/Viewbook/index"></a></li> <li><a href="/union/admissions/Alumni/index"></a></li> <li><a href="../../sample.php"></a></li> <li style="line-height:0px;font-size:0px;">*</li> </ul> </div> Here is the pertinent CSS Code: /* Style for three levels of unordered lists */ #Menu #nav_level_1 { list-style-type:none; width: 200px; margin-left: 0px; padding-left: 0px; margin-top: 0px; padding-top: 0px; background-color: #d2c6aa; line-height:17px; word-wrap: break-word; } #nav_level_2 { list-style-type:none; width: 200px; margin-left: 0px; padding-left: 0px; margin-top: 0px; padding-top: 0px; background-color:#ded4bc; line-height:17px; word-wrap: break-word; } #nav_level_3 { list-style-type:none; width: 200px; margin-left: 0px; padding-left: 0px; margin-top: 0px; padding-top: 0px; background-color:#e5dece; line-height:17px; word-wrap: break-word; } /* End unordered list base styles */ /* To get indented, wrapping, text that's cross browser compatible we need to additionally style the unordered lists and line items under each top <ul> */ #nav_level_1 li { margin-left:20px; } #nav_level_1 li ul { margin-left:-20px; } #nav_level_2 li { margin-left: 40px; } #nav_level_2 li ul { margin-left:-40px; } #nav_level_3 li { margin-left:60px; } #nav_level_1 #nav_active { background-image: url(http://waterfall.union.edu/images/navigation/nav_current.gif); background-repeat: no-repeat; background-position: 4px; background-color: #f2ede1; margin-left:0px; padding-left: 20px; } #nav_level_2 #nav_active { background-image: url(http://waterfall.union.edu/images/navigation/nav_current.gif); background-repeat: no-repeat; background-position: 24px; background-color: #f2ede1; margin-left:0px; padding-left: 40px; } #nav_level_3 #nav_active { background-image: url(http://waterfall.union.edu/images/navigation/nav_current.gif); background-repeat: no-repeat; background-position: 44px; background-color: #f2ede1; margin-left:0px; padding-left: 60px; } #Menu #submenu { list-style-type: circle; padding-left: 0px; margin-top: 0px; padding-top: 0px; background-color:#d2c6aa; line-height:17px; word-wrap: break-word; } #submenu2 { list-style-type:circle; margin-left: 0px; padding-left: 0px; margin-top: 0px; padding-top: 0px; background-color:#ded4bc; line-height:17px; word-wrap: break-word; } The CSS background-position: right; is not working in Firefox/Netscape, and just aligns the background image to the left. Know why? I have an navigation menu that I am building as an unordered list. What I have is an image rollover that appears at the bottom of the navigation menu when the cursor hovers over one of the first level links by using a span within the link that has its display set to none, and then set to absolute positioned directly below the navigation menu on a:hover. Here is an example: Code: <ul> <li> <a href="link1.html" id="link1">Link<span></span></a> </li> </ul> .link a { some link height } .link a span { display: none; } .link a:hover span { position: abolute; top: (some link height * the number of links); background-image: (some image url) width: (image width) height: (image height) } Appearance: ------ Link1 Link2 Link3 Link4 ------- ------- Rollover Image to appear here ------- The problem that I have is that since the rollover image is positioned absolutely, if the size of the list of links changes (IE with sub-links in the list) it slides under or over where I have the rollover image placed. IE ------ Link1 sublink1 sublink2 Link2 Link3 Link4 ------- will break my scheme. Is there a way to get the span within the link to show up relative to the bottom of the <ul> element, or at the bottom of an element that contains the whole shebang? If I cant get this to work, I'm going to be forced to adopt the existing tables/javascript based template for our site, and I'd hate hate hate to do that. thanks. I have a "see details" link over in the bottom right of a table cell - exactly were I want it. But when I resize the browser window to make it smaller and squish it together the link does not stay in its cell but goes left crashing into content. How do I keep it wrapping but still hugging the right wall of the rightmost cell? Using Mozilla. I have the code below - you'll see. Thanks <html> <table border 1px> <tr> <td>Configuration Management System</td> <td><ahref=http://ms.fc.na.bz/>http://ms.fc.na.bz/</a></td> <td>Source for configuration management documents and drawings from many projects. These are primarily engineering design documents. Each Directorate must be searched separately... <a STYLE="position: absolute; right: 20px; color:red;" href=details. php?id=3&Type_view= detail&Type_Submit=&key_word= > see details</a> </td> </tr> </table> <html> Hoping someone can help. I'm trying to figure out a way to align something to the left of an existing element within a container of variable height. The existing element is already aligned to the left edge of the container. To be more specific, I am trying to place a helper graphic to the left of the email text-field in the "Leave a Comment" form (not the "Email this Zing" form) on this page: http://www.zingfu.com/?zing=4419693e9e98f If it's possible to the place the helper graphic right next to the text field in the code, but then to break it out of the container div to move to the left of the text field, that would be great. Or if I could apply positioning to the helper graphic based on the positioning of the text field, that'd be fine too. But I'm not sure if either is possible. Little help? For most of my webpages, I use a few element templates for body, div, etc. I'm using more positioning in my pages, and so for the sake of nested div's, I want to add some standardized positioning to my template:
Code: div{ padding: 0; margin: 0; border: 0 #000000 solid; /*** added positioning atributes ***/ position: relative; top: 0; left: 0; z-index: 0; } I know that some of this is "standard", but I want to be absolutely sure the browser is going to render my page as I want it. My question is, will/should adding this positioning increase the processing/rendering time of the page (as using table-less design uses a lot of divs)? It's probably a silly thing to worry about, but I'm also interested in what atributes are more processing intensive. Please look at this page - http://www.mts-diesel.com/index.php?cPath=20_23_42 The breadcrumb trail links on the main page in FF are higher up than the same element in Chrome and IE. If anyone can shed some light it would be greatly appreciated. Thanks so much, Tom I don't know why but for some reason I thought if you give an element a position of absolute the margin is irrelevant. Not so in FF huh? Tom I have a sad feeling that its not possible, but I thought I'd ask anyway... I have a box element that is 150px x 400px with overflow: scroll; The box contains a large list of links. Now, the user can scroll down and click on a link in the box, which causes the page to refresh. Is there a way of making the scroll bar in the box "drop down" to the element that was clicked when the page is refreshed? It would be very similar to how named anchors work to force a whole page to scroll to a certain position.... I can't figure out why the ul with the id #two is not responding to my position attempt. It is child of an li in the ul w/ a class .menu on www.eagletransmission.net If you mouse over Gallery the dropdown should be flush with the left side of the parent li but it is not. Aaaaargh Tom Hey, I've got a quick question - I know this must have a common workaround to it, I just can't seem to find it. I have a div positioned absolutely within several parent divs making up the rest of the page. To put the issue simply, it seems to be positioning this child div relative to the body. top:20; and left:20; will put it 20 from the top and left of the body of the page rather than he top and left of the block level div it's nested within. There's no positioning applied to its direct parent. The issue is the same in both IE5.5+ and FF. I can whip up a code example, but I think this is a simple issue that would be easier interpreted as I've put it. Thanks in advance for any help on this. =) Hi all, I am having a problem with Firefox and Opera when it comes to background image positioning. It works fine in IE 5-7 and Netscape but... Opera places the image in the top left and Firefox places it at the lowest point of the body e.g. The Div tag and not the bottom of the page. I have uploaded the site for people to get the idea. click here the CSS code is as follows: Code: body { font-size:62.5%; font-family: Tahoma, Verdana, Arial; margin:0px; border:0px; background-color:#C98531; background-image :url(../images/background.gif); background-position:bottom left; background-repeat:no-repeat; } Thanks in advance. Tom In IE7 on this page http://hometown.tmhdesign.com the background image position for my #main div is being ignored Code: #main { width: 990px; margin: 0 auto; min-height: 300px; background: red url(images/style1/main1_div_bg.gif) 0 427px !important; text-align: left; } Hi, I have to get background position of image from a css class in a javascript function. [CODE] abc.button { width: 47px; background-image: url(../bt/save.gif); background-position: 0 -123px; } [CODE] I am able to get it in IE using backgroundPositionX and backgroundPositionY [CODE} var x = document.getElementById('abc').currentStyle.backgroundPositionX; var y = document.getElementById('abc').currentStyle.backgroundPositionY; [CODE} But I am not able to get the background position in FireFox. Is there a way to get background position of image in Firefox. Thanks hey, i have this code below at the top of my page...the image that is there a a background image i would like to more to the right a bit so that some of the orange background is shown on the left!! can anyone advise how i do this please?? thanks Code: #TitleBar { margin:0px 0px 10px 0px; padding:28px 0px 5px 10px; padding-left:10px; /* For IE5/Win's benefit height = [correct height] + [top padding] + [top and bottom border widths] */ height:33px; /* 14px + 17px + 2px = 33px */ border-style:solid; border-color: #ffffff; border-bottom: 1px #ff9900 solid; border-width:1px 0px; /* top and bottom borders: 1px; left and right borders: 0px */ line-height:11px; background-color:#ff9900; background-image:url(../images/webmedia72.gif); background-position: left; background-repeat: no-repeat; /* This is a fix for IE% */ voice-family: "\"}\""; voice-family:inherit; height:14px; /* the correct height */ } /* "be nice to Opera 5" */ body>#TitleBar {height:14px;} thanks RF CSS : Code: body{ margin:0; background-image:url(images/pattern1.gif); padding-left:5%; padding-right:5%; } h1{ background : url(images/logo.gif) no-repeat; width:291px; height: 127px; } #main{ background : #FFFFFF url(images/back.gif) repeat-x; border-left: 8px solid #5D5F60; border-right: 8px solid #5D5F60; } HTML: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" title="standard" href="blueDream.css"/> <title></title> </head> <body> <div id='main'> <h1></h1> </div> </body> </html> There appears to be a very strange gap on the left side of the heading background which I cannot seem to get rid of. Any ideas? I have the following CSS and HTML: Code: <DIV STYLE="width: 50px; height: 10px; line-height: 10px; background-color: #D0D0D0;"> <DIV STYLE="width: 100%; height: 100%; background: url(/imgs/blog/stars/smallblock.png) -15px 0px no-repeat;"> </DIV> </DIV> In all browsers except Safari the outer div is covered by the inner div except for the very last 15px, hence the -15px to offset it. In Safari the inner div covers all of the outer div. Any way to fix this? I'm currently using the tutorial located at Use Sprites to Create an Awesomeness-Filled Navigation Menu Based on that I've created a sprite image that is 960x88. I've got my menu in place, but the background-position completely fails. While I can change the width of each item, revealing more or less of the image it still only shows the first part of the image, repeating "Home". See attached screenshot for example of what it's doing. Here is my HTML and CSS: html Code: Original - html Code <nav> <ul id="main_nav"> <li><a href="#" class="home"></a></li> <li><a href="#" class="case_studies"></a></li> <li><a href="#" class="solutions"></a></li> <li><a href="#" class="free_quotes"></a></li> <li><a href="#" class="government"></a></li> <li><a href="#" class="recycle"></a></li> <li><a href="#" class="resources"></a></li> <li><a href="#" class="about_us"></a></li> <li><a href="#" class="contact_us"></a></li> <li><a href="#" class="login"></a></li> </ul> </nav> <nav> <ul id="main_nav"> <li><a href="#" class="home"></a></li> <li><a href="#" class="case_studies"></a></li> <li><a href="#" class="solutions"></a></li> <li><a href="#" class="free_quotes"></a></li> <li><a href="#" class="government"></a></li> <li><a href="#" class="recycle"></a></li> <li><a href="#" class="resources"></a></li> <li><a href="#" class="about_us"></a></li> <li><a href="#" class="contact_us"></a></li> <li><a href="#" class="login"></a></li> </ul> </nav> css Code: Original - css Code #main_nav { height: 40px; } #main_nav li { float: left; } #main_nav li a { background:url(../images/main_nav_sprite.png); display: block; height: 40px; } .home { background-position: 0px 0px; width: 60px; height: 40px; } .case_studies { background-position: -60px 0px; width:120px; height:40px } .solutions { background-position: -180px 0px; width:100px; height:40px } .free_quotes { background-position: -280px 0px; width:100px; height:40px } .government { background-position: -380px 0px; width:120px; height:40px } .recycle { background-position: -455px 0px; width:75px; height:40px } .resources { background-position: -555px 0px; width:100px; height:40px } .about_us { background-position: -642px 0px; width:87px; height:40px } .contact_us { background-position: -748px 0px; width:106px; height:40px } .login { background-position: -822px 0px; width:74px; height:40px }
I'm trying to create a block quote like in the image below: http://www.norrislakevillas.com/images/block-quote-sample.png The quotation marks sit in the bottom right corner of a 50 X 45 px transparent PNG image with 10px of spacing on the top and left. The element is rendering correctly with the exception of the background image, it just won't show up. CSS Code: Code: #block_quote{ float:left; width:400px; background:#f7f7f7; background-image:url(images/quote-top.png) left top no-repeat; margin:50px 0 100px 53px; border:1px solid #ccc; } #block_quote p{ font:italic 14px segoe ui, arial, sans-serif; color:#5f5f5f; line-height:1.4em; margin:0; padding:20px 15px 20px 60px; } Any ideas why the image isn't rendering? Thanks |