CSS - Alternate Css Tr Background
Hi all,
i have sum problem in css, want to create alternate tr(row) color appear in dynamic table creation , and it shoul be pure css code. hlp me if any one ! tanks Similar TutorialsHi All, I'm rejigging an intranet site to make its display context specific. So when you log in from Branch Office 1 you see one thing and from Branch Office 2, you see something else. Part of the rejig is to give each Branch Office its own colours and icon set. I'm using a set of alternate links, (e.g. <link href="branch1.css" rel="alternate stylesheet" type="text/css" title='B1' /> ) for the non-structural css. These contain all the new colours and background images. However, the main css still contains the original colours and images. My intent is for the alternate stylesheets to override the main css. To be sure this happens, they are included after the main.css Mostly things work fine. But I have an odd problem with html element that have multiple classes. Code: <div class=" gateway gwWarmfuzzies "> <h3><a href="warmfuzzies/">Warm Fuzzies</a></h3> <p>Help celebrate some of our colleagues' achievements.</p> </div> This is in main.css: Code: div.gateway { padding-left: 95px; width: 195px; float: left; background-color: #fff; background-repeat: no-repeat; background-position: top left; margin: 1em 5px 8px 0; height: 67px; } .gwWarmfuzzies { background-image: url(../i/gf/warmfuzzies.gif); } .gwWarmfuzzies should be overridden by one of the alternate stylesheets. Code: .gwWarmfuzzies { background-image: url(../i/gf/ BRANCH1 /warmfuzzies.gif); } The alternate version of gwWarmfuzzies is completely ignored. I've tried removing the main.css version of gwWarmfuzzies. When I do that, no background-image is applied at all. This does not happen when the element has a single class, only with multiple classes. Advice? What i am trying to do is when the user tries to print out the HTML document, then the printer prints out what is in this: <link rel=alternate media=print href="printthis.doc"> It works in IE but it doesn't work in Mozilla Firefox. Does anyone know a way on how this is done in Mozilla Firefox or even both...?? Cheers, Jackson Dear all, I want to add a print icon to my pages, which would print an alternate page (a printer friendly version). I have the following code: <link href="print.php?cli_id=2" rel="alternate" media="print" /> This works fine if I use the print icon in my browser, but if I use javascript:window.print(); within the page, it seems to ignore the alternate printer friendly page. My page appears in frames, and I plan to remove the browser toolbar and replace with a custom one in the page once the application is complete. Any ideas anyone? many thanks, Mark Quote: Dan Cederholm of SimpleBits: It's important to note that the cascading effect of CSS still applies, and alternate style sheets work just like any other style sheet, in that only common rules are overridden when the alternate styles are active. So if we had layout, positioning, and other site-wide rules in default.css that weren't repeated in the alternate style sheets, those default rules would still work. I'm making a site that has a default stylesheet with a fixed layout and an alternative one with a fluid layout. The problem I'm having is the alternative sheet not inheriting css from the default stylesheet even though the rules are not overridden. At the moment, my alternative stylesheet is an exact copy of the original (everything included) with only 3 width values changed to percentages. Theoretically, I should be able to only include these three rules alone in the alt sheet, as rules are carried over from the default sheet unless overridden. However, when I do try to reduce the alt sheet to just: Code: #container { width: auto; } #main { width: 65%; } #navbar { width: 30%; } all unincluded formatting is lost. Am I doing something wrong? Cheers, Sam. I have a div with a background color set, that I want to have slightly transparent. Inside that div, is essentially my entire website. Now if I apply the opacity to the main outer div, all the divs inside inherit that transparency. Any ways to get around this? The outer Div with the transparency is the "content_wrapper" div. It excludes the header and footer. So the only issue is correcting everything wrapped inside the "content_wrapper" and "content" div. I tried setting the "content" div to opacity: 1; but it had no effect whatsoever. http://www.area51entertainment.co/index.php?about So I have a design where the background is a large (1400x1100) image that fades into a vertical gradient at the edges. I've set up the css as follows: body { background: #000 url(gradient.jpg) repeat-x; margin: 0; } Here's where I run into my problem... I've created an empty DIV to hold the large image which will appear on top of the gradient and positioned it absolutely. <div id="bg_image"></div> #bg_image { width: 100%; height: 1100px; background: url(images/bg_image.jpg) no-repeat top center; margin: 0; position:absolute; } This works and the background looks like it should, however because the large image is inside a DIV, any time the browser window is smaller than that div (which will be the case for most users considering the image size) there will be scrollbars. This makes perfect sense of course I just can't come up with an alternative. If there was a way to extend a background image beyond the borders of a DIV that would work but overflow:visible; doesn't seem to work with background images only content. I wish I could set a repeating background AND a static background in the body style, because that is exactly the effect I'm trying to achieve. Any suggestions would be greatly appreciated! Thanks, Josh The layout I have going is a bit difficult to explain. Here's a diagram.. The area of importance is the header. The content and main head area are centered. The area to the left and right of the header are a <div>. However, as you can see, the background image on the left is different than the one on the right. I'm having difficulty making this work. the images can be stretched horizontally without a problem, but the two sides must meet in the middle beneath the header. I hope this makes sense. What I've got to do, I think, is tell the background image of the underlying <div> to stretch to 100%, and make this image 300px wide or so including both sides of the image and a split. The split would hide behind the header. I can't find a method to stretch the background image, though. Does anybody know of a better way, or a way to achieve this method at all without getting into completely different layouts? Thanks in advance for any assistance/suggestions. I have a table with a specified background color (specified in CSS). The content part of the table (a cell) uses information from a downloaded script (wordpress.com) to load information. I want the table background to shine through everything. How can I accomplish this (I suspect it is in the script CSS, but I don't know what). URL The 'home' page is how I want it (basically that background effect). But the other pages come out funny with no background. Could someone solve this, or alternatively reccommend another way. In short, I'm trying to get this one image to tile down the page to the bottom, underneath a static background image. Basically, it's a 2pixel high image that's ready to tile vertically, just having a tough time getting it to work. You can clearly see the problem here, a gap at the bottom: http://www.groundedgroup.com/clients/NWR/ Here's the relevant css: http://www.groundedgroup.com/client...WR-GG/style.css I've googled and subsequently tried out some solutions, but no luck. Got any ideas? Thanks in advance. PS - Is there a way to keep the spiders from indexing my links above? The site is on a test server, so I don't want the url indexed. Hi all. I'm having a small but very annoying problem with my new design. I'm using backgrounds for my divs but somehow Internet Explorer manages to push them one pixel upwards and to the left. I can't find out why and after trying things for three hours I don't know what to try anymore. In both Firefox and Opera it works fine! Here is a screenshot where you can clearly see what goes wrong. The one on the top is Internet Explorer, the one on the bottom is made in Firefox and is how it is supposed to be. URL Site: URL CSS: URL I also found out that the footer of my page doesn't go to the bottom correctly in Opera. If anybody knows how what the problem is there and how to fix it I will be the happiest person on earth Thx in advance. Greetings, Sjoerd Hi, I'm building a website for my work and got in a little trouble. I do not know if it is just the browser or the code. I'm new to this CSS and HTML so i'm not 100% sure. I needed my background fixed which i had done, and on my home computer the main stuff on my page just floats above the background. On my work computer the main information is when you scroll down, after the background image. I'm confsued and wondering if anyone could help, thanks. Here is also a link to the page so you can see what the problem is, http://www24.brinkster.com/mattphat/ymca2.html Code: <html> <head> <TITLE>Northwest Connecticut YMCA | We build strong kids, strong families, strong communities.</TITLE> <style type="text/css"> html {height:100%;}body {height:100%; margin:0; padding:0;} #bg {position:fixed; top:0; left:0; width:100%; height:100%;} #content {position:relative; z-index:1;} </style> <!--[if IE 6]> <style type="text/css"> html { overflow-y: hidden; } body { overflow-y: auto; } #bg { position:absolute; z-index:-1; } #content { position:static; } </style> <![endif]--> </head> <body> <! --- --- BACKGROUND IMAGE --- ---> <div id="bg"> <img src="YMCA/graudal1.jpg" width="100%" height="100%"> </div> <! --- --- DONE BACKGROUND IMAGE --- ---> <! --- --- MAIN PAGE BORDER--- ---> <div id="content"> <div align="center"> <table width="727" border="1" color="#736F6E" cellspacing="0" cellpadding="0"> <! --- --- DONE MAIN PAGE BORDER--- ---> <!--- --- MAIN PAGE POSITION STAY --- ---> <td align="left" valign="top" bgcolor="#FFFFFF"> </td> <td rowspan="2" align="left" valign="middle" background="" bgcolor="#000000"> <form id="search" name="search" method="get" action="search_results.asp"> <table width="383" border="0" cellspacing="0" cellpadding="0"> <!--- --- DONE MAIN PAGE POSITION STAY --- ---> <!--- --- NWCTYMCA LOGO --- ---> <td align="left" valign="top" bgcolor="#FFFFFF"> <img src="YMCA/NWLOGO2.JPG" width="727" height="289" border="none" usemap="#Map"> </td> <tr> <td colspan="2" bgcolor="#FFFFFF"> </td> </tr> <!--- --- DONE NWCTYMCA LOGO --- ---> <!--- --- BARS ABOVE LINKS --- ---> <!--- BLACK BAR ---> <tr> <td colspan="2"> <img src="images/clear_spacer.gif" width="727" height="0"> </td> </tr> <!--- RED BAR ---> <tr align="left" bgcolor="#A93333"> <td colspan="2"> <img src="images/clear_spacer.gif" width="727" height="0"> </td> </tr> <!--- STRONG KIDS BAR ---> <tr align="center" bgcolor="#FFFFFF"> <td colspan="2"> <img src="http://www.ymcadc.org/PublishingImages/webuild_tagline.gif" width="360" height="15"> </tr> </td> <!--- --- DONE BARS ABOVE LINKS --- ---> <!--- --- LINKS --- ---> <tr bgcolor="#FFFFFF" border="0" cellspacing="0" cellpadding="0"> <td colspan="2"> <div align="left"> <img src="ymca/miniY.jpg"></img> <!-HOME-> <a href="http://www24.brinkster.com/mattphat/YMCA2.html" ONMOUSEOVER=rollover.src="YMCA/homelink2.jpg" ONMOUSEOUT=rollover.src="YMCA/homelink.jpg"> <img src="YMCA/homelink.jpg" name="rollover" width="89" height="28" border="0"></a> <img src="images/nav_line.gif" width="1" height="25"> <!-TORRINGTON-> <a href="http://www24.brinkster.com/mattphat/ymcatorrington.html" ONMOUSEOVER=rollover2.src="YMCA/Torringtonlink2.jpg" ONMOUSEOUT=rollover2.src="YMCA/Torringtonlink.jpg"> <img src="YMCA/torringtonlink.jpg" name="rollover2" width="140" height="28" border="0"></a> <img src="images/nav_line.gif" width="1" height="25"> <!-WINSTED-> <a href="http://www24.brinkster.com/mattphat/ymcawinsted.html" ONMOUSEOVER=rollover3.src="YMCA/winstedlink2.jpg" ONMOUSEOUT=rollover3.src="YMCA/winstedlink.jpg"> <img src="ymca/winstedlink.jpg" name="rollover3" width="109" height="28" border="0"></a> <img src="images/nav_line.gif" width="1" height="25"> <!-CANNAN-> <a href="http://www24.brinkster.com/mattphat/ymcacannan.html" ONMOUSEOVER=rollover4.src="YMCA/cannanlink2.jpg" ONMOUSEOUT=rollover4.src="YMCA/cannanlink.jpg"> <img src="ymca/cannanlink.jpg" name="rollover4" width="93" height="28" border="0"></a> <img src="images/nav_line.gif" width="1" height="25"> <!-GIVING-> <a href="http://www24.brinkster.com/mattphat/ymcagiving.html" ONMOUSEOVER=rollover5.src="YMCA/givinglink2.jpg" ONMOUSEOUT=rollover5.src="YMCA/givinglink.jpg"> <img src="ymca/givinglink.jpg" name="rollover5" width="86" height="28" border="0"></a> <img src="images/nav_line.gif" width="1" height="25"> <!-ABOUT US-> <a href="http://www24.brinkster.com/mattphat/ymcaaboutus.html" ONMOUSEOVER=rollover6.src="YMCA/aboutuslinks2.jpg" ONMOUSEOUT=rollover6.src="YMCA/aboutuslinks.jpg"> <img src="ymca/aboutuslinks.jpg" name="rollover6" width="104" height="28" border="0"></a> <img src="ymca/miniY.jpg"></img> </div> </td> </tr> <!--- --- DONE LINKS --- ---> <!--- --- BOTTOM RED BAR --- ---> <tr align="left" valign="top" bgcolor="#A93333"> <td colspan="2"> <img src="images/clear_spacer.gif" width="727" height="3"> </td> </tr> <!--- --- DONE BOTTOM RED BAR --- ---> <!--- --- BODY TEXT SECTION --- ---> <td align="left" valign="top" bgcolor="#FFFFFF"> <center> <P>YMCA YMCA YMCA YMCA YMCA YMCA <P>YMCA YMCA YMCA YMCA YMCA YMCA <P><s>FIX BACKGROUND *DONE*</s> <P>NEW STRONG KDIS .GIF <P><s>TOP BAR LINK IMAGES *DONE*</s> <P><s>NEW LOGO / HEADER BAR *DONE*</s> <P>SEE ABOUT NEW COLORS FOR LINK ROLLOVERS <P>LEFT SIDE LINKS FOR EACH PAGE <P>COPYRIGHT INFO AND REGULAR LINKS AT BOTTOM OF PAGE <P>YMCA YMCA YMCA YMCA YMCA YMCA <P>YMCA YMCA YMCA YMCA YMCA YMCA </center> <br> <br> <center> <a href="">Home</a> | <a href="">Torrington</a> | <a href="">Winsted</a> | <a href="">Cannan</a> | <a href="">Giving</a> | <a href="">About Us</a> <br> 2009 Northwest Connecticut YMCA. <br> The YMCA is a 501(c)(3) not-for-profit social services organization dedicated to <br> building strong kids, strong families and strong communities. </center> <!--- --- DONE BODY TEXT SECTION --- ---> </div> </body> </html> I have a div box with a 100% width and a repeating background image on it. Everything works great except when the window is smaller then the actual site. If I resize my window so that the horizontal scrollbar appears, as if I had a 15" monitor, the background image does not go all the way to the edge. Instead it is only the width of the browser window, although the content of that box displays fine. Anyone know how to fix that? I want to make a webpage with ah gradient border on the left and right side of the page. The gradients will be "fading out" towards the middle. How should I do this? I know how to get one side to show up, but not both. Can I use two different backgrounds in one CSS element? (probably not) Or should I use two different <div> tags with backgrounds set with what I want and are as big as the page? Thanks. someone know how to make a web with background like this... http://netcodigo.webinfo.es/ I tried, but I can't do it. pd: Sorry for my bad english. Am design a site just now this is the image of the site here The problem is the blue background what is the best way to do this just now i have it like this by use a repeat of part of the image but want the cloud part at the top left too. I have background image for bullet. However, in Firefox it tries to display several of them for one line, and in IE it is like it should - one background image per line. Ive set background to no-repeat, and it still doesn't work in FF. Help plz. See the problem here http://www.armedassault.org/wp/ Hello, How can add a background color to each table cell in a table header and also add a small image on the bottom right corner of each of those cells? Thanks, Miguel Is it just IE that using a gif as a background url not work... or is that one of the standards.. I know jpgs work.. but why not gifs? whats wrong with this? body { font-family:arial; font-color:#000000; background:url(background/bg.jpg); } its the background bit that isnt working it works when the css is included on the page but when i put it on a seperate stylesheet it hasnt worked Hi there, I am trying to place a fixed backgroung image to a div, which is to be position to the bottom right of the screen. The code I have so far: Code: body#fixed { background-image: url(../images/fixed-bg.png); background-position: bottom right; background-repeat: no-repeat; background-attachment: fixed; } using <div id="fixed"></div> However it doesn't seem to work. I can't add the bg image to the body style as I already have another background image specified for the entire document. Any ideas? |