CSS - Transparent Header Background
Hello,
Tried searching and couldn't find anything. I want my header's background to match that of the body. Essentially, a "see-through" header. Shouldn't this be some easy markup? Thanks. Similar TutorialsI want to have a shadow around the content of my website, but the problem is that the header has a semi-transparent image and so the shadow continues until the top of the page while I want it to stop at the blue header. How can I accomplish this? Screenshot: http://www.yannickv.be/screenshot_massageforum.png My HTML: Code: <div id="wrapper"> <div id="shadow"> <div id="splash" class="container"> <img src="header.png" width="1000" alt="header" /> </div> <div id="menu_up" class="container"> <div id="menu_up_content"> Here comes the horizontal menu... </div> </div> <div id="page2" class="container"> <div id="panel_left"> <div id="fotodiv"> <img src="massagefoto.jpg" width="160px"> </div> </div> <!-- end #panel_left --> <div id="panel_right"> <div id="page" class="container"> <div id="content"> <div class="post"> Here comes the actual content... </div> <div style="clear: both;"> </div> </div> <!-- end #content --> <div id="sidebar"> <ul> <li> <div style="clear: both;"> </div> </li> <li> <ul> Here comes the navigation menu... </ul> </li> </ul> </div> <div id="cleardiv" style="clear: both;"> </div> </div> <!-- end #page --> <div id="footer"> Here comes the footer... </div> </div> <!-- end #panel_right --> <div id="cleardiv" style="clear: both;"> </div> </div> <!-- end #page2 --> </div> <!-- end #shadow --> </div> <!-- end #wrapper --> <div id="footer"> </div> My CSS (stripped down to the essentials): Code: #wrapper { margin: 0 0 auto auto; padding: 0; } #shadow { width: 1000px; margin: 0 auto; -moz-box-shadow: 3px 3px 30px #000; -webkit-box-shadow: 3px 3px 30px #000; box-shadow: 3px 3px 30px #000; /* For IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')"; /* For IE 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000'); } yes my friend has on her site scrollable screen separate from the fixed background but in the code its listed <style type="text/css"> table, tr, td { background-color:transparent; border:none; border-width:0;} body { background-color:91A4F3; now what would the optional choice of turning the transparent off? opaque? Hi, I'm doing a simple one page layout for a friend which is just an iframe over a picture. The iframe can contain alot of data and the picture isn't supposed to repeat. So... I've got the background image fixed in place with the iframe positioned over it, and it looks fine in firefox and netscape, but the background of the iframe is white in IE. Nevermind, I figured it out... Thanks, Hope I have divs layering on top of each other, and they have background images (gifs). In Firefox, the transparency looks fine, but in IE the transparent areas are colored in. How can I fix this? thanks. Hi, The page in question can be found he http://serve5.net/xcage/. Basically, if you view it in Firefox/Mozilla, the background png for the element that contains the date is transparent with a tint to it. However, if you view the page in Internet Explorer, it is gray rather than transparent. Could someone take a look and tell me what's wrong? The CSS can be found he http://serve5.net/xcage/css/standard.css. Thanks, Rob. I was wondering if there is a way to make your wrapper have a background color to make your font more readable but still be transparent so that you still can see the body background pic? Hopefully this doesn't sound like a stupid question. Is that possible? What would be the code for that? Hello I have a background image in my web site which is centered and fixed with no repeat. I would like to make it some what transparent. I know that it can be done by manipulating the image itself, but I need to do it dynamically using CSS. I tried adding the filterpque(alpha=0.5 style=0) attribute to the body but that made all the elements in the body (except for background image) transparent. does anyone know how I can do it? Are there any workarounds to get a transparent png that is being used as a background-image to be affected by background-: position, attachment, or repeat. This site says it's not possible: http://www.satzansatz.de/cssd/tmp/a...ansparency.html But Im hoping that over time someone has come up with a fix ... Thanks, Mark Hi everyone. developing a page where I use CSS style #content { width: 760px; background-image: url(didyouknow1.png); background-repeat: no-repeat; background-color: #cccccc; height: 300px; } Page background is #cccccc. When I add the div tag <body> <div id="content">Content for id "content" Goes Here</div> </body> and preview in IE 6 there is a lighter color gray AROUND the image . Have not tested in FF. IMAGE Attached. Any suggestions how to make the tranparency really work? Looks fine in Dreamweaver8. Thanks Roman is there a way to set background color of a text box to transparent? I expected this to be working: 'background-color:transparent; I have a floating div on top of a larger div that has a background. What I would like is to have the background of the floating div transparent so the background can be seen. However, when I make it transparent, it forces my text to be transparent also. Any ways around this? I want to make a css "div-popup", and when it pops up the whole page behind the popup should be covered in 50% transparent black. I suppose this has been done before, but I failed to google it, I don't know what to search for Any ideas? Hi everyone, I am using nivo slider for a website that I'm building. I have created a gradient png for the background of the captions that will go over the slider images. Everything is working perfectly in ie9 and FF, however in ie8 and 7 all I get is a big black block where the gradient should be. The strange thing is that if I set a background color, then the gradient shows through. I have tried to make the background transparent with no luck at all. I have tried to set the background-color to transparent, and made it !important. I've also tried to use filters, nothing seems to work. The URL of the site is http://www.backupstorage.co.za/new/ . If anyone out there can help, I really would be incredibly grateful! hello mates, for the "footer" of my webpage, i need to have the left part holding a transparent gif image (can be background image or html object, don't care as long as it shows correctly the background image of the page), and the right part to extend to the rest of the containing "footer" div, with a background-color. But i can't make the two cohabitate peacefully. :'( i've tried with divs, span and p, no matter what it does not work. here is the way i first thought it would work: Code: <div id="footer" style="clear:both;width:100%"> <div id="transparentImg" style="width:460px;height:22px;background:url(image.gif) no-repeat"></div> <div id="colorstripe" style="width:inherit;height:22px;background-color:red;text-align:right">disclaimer</div> </div> any idea how to make this happen ? Hey All, It's been a while, and my CSS knowledge is a bit rusty (not that it was ever all that;-). Anyway... Working on a custom wordpress admin write panel, I have a table with dynamic classes in a helper.css for indicating row status(includes .myclass tr:hover), which works great everywhere EXCEPT in our old friend IE6. Turns out that the wordpress "global.css" for admin panels defines the following: Code: html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,bi g, cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt ,dd, ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td { margin:0;padding:0;border:0;outline:0;background:transparent;} where, though I can't remember how I stumbled onto it, upon removing "background:transparent;" in wp admins global.css everything is hunky dory in IE6 too -- ok, not the tr :hover{ because IE6 only supports :hover on <a>s. but at least the row classes are displayed with no other discernible impact on this or any other admin pages in IE6 or any other browser. Of course, I don't want to go changing wordpress core code just to scratch my little itch, but I was hoping someone might suggest a means of overriding the background:transparent in wp admins global.css either in my own helper.css or in the on the page itself? Hey All! Hope i didnt scare tooo many people off with the title! Im new to playing around with transparency and am having trouble with getting the affect i want! What i want: 1. Page background as a large picture (1280 x 1024) non repeating etc. (The picture is of a grassey field) 2. a semi transparent rounded white box that sits in the middle (dimensions 735x 550) 3. on top of the semi transparent box i want my content. The reason i want it semi transparent is because i want the main background to come through and be visible through the content. and if the page is resized etc that the semi transparent box can move over the background and show the background whereever it is! Problems: 1. My first attempt i could get 90% of the look i wanted. I got the semi transparent box floating in the middle of the page and showing the background through perfectly. as soon as i add content the content is also transparent. i tried adjusting the trnasparency for the content but that didnt work. e.g. Code: <div id="semiTransBox"> <div id="content">blah blah blah</div> </div> note i dont have my actual code in front of me so please try and work with this! The wording "blah blah blah came out as transparent as its parent semiTransBox. Not what i wanted! I understand this is something to do with the parent child relationship with transparency so i tried something different for my second attempt: 2. i created the semi Transparent box and then added a second fully transparent div below which was positioned using css to move up 500px to fit over the semi transparent box. using top:-500px; position:relative e.g. Code: <div id="semiTransBox"></div> <div id="transBox"> <div id="content">blah blah blah</div> </div> The content is not transparent now but there is still a problem The problem is now because i have created the second div below the first it has caused the browser to add scroll bars to the window and shows white are where the main picture doesnt fill. is there a way to get rid of the space where the second div used to be? i really hope that essay made sense! thanks Hello, after a few hours I managed to identify the CSS element responsible for this problem. However so far I have no solution on how I could solve this problem. Basically the problem is very minor but still frustrating. I am using the following command to set a DIV element with transparent background; Code: filter: progid:DXImageTransform.Microsoft.gradient (gradientype=0,startColorstr='#60ff0000', endColorstr='#60ff0000'); The DIV element becomes transparent. However the parent element - which is set with the CSS attribute overflow:hidden - is always displaying an extra pixel on the right of the container. This might not be clear at first, which is why I attached the following screen shot. (the light red line is the extra 1px I am referring to) If I remove the transparency CSS attribute for IE8 then this extra 1px will disappear. However that means loosing the wanted transparency. I have also developed the following example of the problem; 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"> <head> <style> body { margin: 0px; padding: 0px; /* * IE hack to center .content div (part1). */ *text-align: center; } div.content { width:600px; margin: 0px auto; /* * IE hack to center .content div (part2). */ *text-align: left; } div#a { border-bottom: 1px solid grey; border-top: 1px solid grey; padding-bottom: 5px; padding-top: 5px; } div#a div#b { overflow: hidden; height: 280px; position:relative; } div#a div#b div#c { position: absolute; } div#a div#b div#c img { border: none; display: block; } div#a div#b div#e { background-color: red; color: #fff; position:absolute; padding: 20px 10px; width:260px; height: 240px; margin-left: 500px; /* IE8 hack for background colour with alpha value */ filter: progid:DXImageTransform.Microsoft.gradient (gradientype=0,startColorstr='#60ff0000', endColorstr='#60ff0000'); } </style> </head> <body> <h1>Test 5</h1> <div id="a" class="content"> <div id="b"> <div id="c"> <img src="pic.png" /> </div> <div id="e"> hello </div> </div> </div> </body> </html> Does anyone know what's causing the problem and how I can solve it. It is true that 1px might not sound much. But it still frustrates me knowing that it is there and the fact that on Firefox all works great. Hello, I am trying to create a header with a background color and a padding of the text. I know that if I apply the background color to the header it will expand 100%. So I did the following: <h1><span>Header</span></h1> h1 {} h1 span { background-color: #252525; color: #D2D2D2; font: normal 1.2em/1.8 Verdana, Geneva, sans-serif; letter-spacing: 0.1em; padding: 0.8em; } But now I am not able to apply the top and bottom padding. How should I create this header? Thanks, Miguel Hey, Im pulling my hair out...basically iv developed a site testing it in safari and when i have come to test it in FF the background image i am displaying in my header div doesn't display in FF but displays fine in Safari, unable to check IE atm. Iv broken down my code down and put together a simple test html script and css script and still no joy. Below is the script can anyone see where i am going wrong...hope so. 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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Background Image Test</title> <link rel="stylesheet" type="text/css" href="millar.css" /> </head> <body> <div id="container"> container <div id="header"> header </div> <div id="main"> main </div> <div id="footer"> footer </div> </div> </body> </html> Code: body { background-color: #F0F0F0; font-family: verdana; font-size: 10px; color: #333333; } #container { background-color: red; margin: 0 auto; } #header { background-color: yellow; height: 100px; background-image: url('topbanner.jpg'); } #main { background-color: blue; } #footer { background-color: green; } cheers tom Hi guys, I know most of you are probably not familiar with the blogger code, but I wanted to see if I code post some bits of code and maybe you can help me with my problem. My problem is, is that I'm trying to add a google adsense search bar in the header of my blog (www.mytechnicalinterviewexperience.com). Here is the piece of code that initially defines the header: Code: #header-wrapper { background:$titleBgColor url("http://www.luckyninedesign.com/tech/header.gif") no-repeat $startSide top; margin-top:22px; margin-$endSide:0; margin-bottom:0; margin-$startSide:0; padding-top:8px; padding-$endSide:0; padding-bottom:0; padding-$startSide:0; color:$titleTextColor; height:105px; } So in blogger, you can make it so you can add a "widget" to the header, and in that widget is where I'll be able to put my adsense code. However, when I add the widget, the adsense search bar appears, but it also puts the background image that I have defined for #header-wrapper. Here is the code that appears after I add the widget: Code: <b:widget id='HTML2' locked='false' title='' type='HTML'> <b:includable id='main'> <!-- only display title if it's non-empty --> <b:if cond='data:title != ""'> <h2 class='title'><data:title/></h2> </b:if> <div class='widget-content'> <data:content/> </div> <b:include name='quickedit'/> </b:includable> </b:widget> Basically, I just want to add a new widget to the header without having the header background appear again. Is there any code I can add here that says, don't have the background appear? I've tried removing the if statement but it does not work. If there is anything else I can provide you with, let me know. Any help would be much appreciated, thanks. Joe |