CSS - Trying To Hide Text & Leak Image, Nothing Shows Up
Hey all,
I'm trying to make some links using the normal list method, and have the link class leak the image. Right now nothing is showing up...no text, no button/image...nothing. It's rather baffling to me, because I have pretty much the same code working on a different page. I can't see anything that would cause this. I would very much appreciate it if you have a look at my code and see if you can see something I missed. CSS: Code: .box1{ width:900px; height:700px; background-image:url(bg.jpg); } #links{ width:853px; height:31px; margin: 0 auto; text-align:center; line-height:0; display: block; overflow: hidden; text-decoration: none; text-indent: -99999px; font-size: 0.0; line-height: 0.0; background-repeat:no-repeat; } #links li{ float: left; list-style: none; } a.link1{ width:185px; height:31px; display:block; background-image:url(bg.gif); background-position: 592 25px; } HTML: Code: <div class="box1"> <ul id="links"> <li><a href="#" class="link1" title="Job Description">Job Description</a></li> <li><a href="#" class="link1" title="Home">Job Description</a></li> <li><a href="#" class="link1" title="Home">Job Description</a></li> <li><a href="#" class="link1" title="Home">Job Description</a></li> </ul> </div> Thanks much Similar TutorialsWhen I preview my page in firefox on my Mac, (via Dreamweaver's Preview function), I can see the main logo image fine. However, when I uploaded the page and image correctly, I only get a blank area. I think this is a css issue, but I can't figure it out. http://alpineec.com/TEST/index.php Any thoughts? CSS Code: * { padding: 0em; margin: 0em; } body { background-color:#999999; padding: 35px 0px 35px 0px; } body,input { font-size: 10pt; font-family: "georgia", "times new roman", serif; color: #333333; } p { line-height: 1.5em; margin-bottom: 1.0em; text-align: justify; } a { color: #B96D00; text-decoration: underline; } a:hover { text-decoration: none; } h3 span { font-weight: normal; } h3,h4 { display: inline; font-weight: bold; background-repeat: no-repeat; background-position: right; } h3 { font-size: 1.7em; padding-right: 34px; background-image: url('images2/db1.gif'); } h4 { font-size: 1.2em; padding-right: 28px; background-image: url('images2/db2.gif'); } .contentarea { padding-top: 1.3em; } img.left { position: relative; float: left; margin: 0em 1.8em 1.4em 0em; } img.right { position: relative; float: right; margin: 0em 0em 1.8em 1.8em; } .post .details { position: relative; top: -1.5em; font-size: 0.8em; color: #787878; } .post ul.controls { clear: both; } .post ul.controls li { display: inline; font-size: 0.8em; } .post ul.controls li a { background-repeat: no-repeat; background-position: left; padding: 0em 1.0em 0em 20px; } .post ul.controls li a.printerfriendly { background-image: url('images2/icon-printerfriendly.gif'); } .post ul.controls li a.comments { background-image: url('images2/icon-comments.gif'); } .post ul.controls li a.more { background-image: url('images2/icon-more.gif'); } .box { position: relative; background: #FDFCF6 url('images2/boxbg.gif') repeat-x; left: -1.5em; top: -1.5em; padding: 1.5em; border-bottom: solid 1px #E1D2BD; margin-bottom: 1.0em; } ul.linklist { list-style: none; } ul.linklist li { line-height: 2.0em; } #upbg { position: absolute; top: 0px; left: 0px; width: 100%; height: 275px; background-color:#999999; z-index: 1; } #outer { z-index: 2; position: relative; /* The width value below controls the overall width of the design. By default it's set to 82% (so it'll take up 82% of the browser window's width). You can set it to a different percentage value (70%, 90%, etc.) or even a pixel value (760px, 800px, etc.) to enforce a fixed width. */ width: 700px; border: solid 1px #fff; background-color: #fff; margin: 0 auto; } #header { position: relative; width: 100%; background: #5a5a5a; } #headercontent { position: absolute; bottom: -56px; padding: 0em 2.0em 1.3em 2.0em; left: 274px; } #headercontent h1 { font-weight: normal; color: #fff; font-size: 2.5em; } #headercontent h1 sup { color: #777; } #headercontent h2 { font-size: 1.0em; font-weight: normal; color: #aaa; } #menu { position: relative; background: url('images2/menubg.jpg') repeat-x top left; height: 20px; padding: 0em 1.0em 0em 1.0em; } #menu ul { position: absolute; top: 2px; } #menu ul li { position: relative; display: inline; } #menu ul li a { padding: .5em 1.0em 0.9em 1.0em; color: black; text-decoration: none; font-family:Arial, Helvetica, sans-serif; font-weight:bold; } #menu ul li a:hover { text-decoration: none; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color: #FE3D00; } #menu ul li a.active { text-decoration: none; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color: #FE3D00; } #content { padding: 0em 2.0em 0em 2.0em; } #primarycontainer { float: left; margin-right: -18.0em; width: 100%; } #primarycontent { margin: 1.5em 22.0em 0em 0em; } #secondarycontent { margin-top: 1.5em; float: right; width: 18.0em; } #footer { position: relative; height: 2.0em; clear: both; padding-top: 5.0em; background: #fff url('images2/border2.gif') repeat-x 0em 2.5em; font-size: 0.8em; } #footer .left { position: absolute; left: 191px; bottom: 1.2em; z-index: 10; } #footer .right { position: absolute; right: 2.0em; bottom: 1.2em; } pre { padding:10px; border: 1px dotted #eee; background-color:#f9f9f9; } #photodiv { background-repeat: no-repeat; } #aboutBLOCK{padding-left:40px;} /* PHOTO GALLERY */ #pg { border:2px dotted #666; padding:5px; padding-top:15px; } #pg ul { list-style:none; left: 10px; padding:0; margin:0; position:relative; float:left; } #pg ul li { display:inline; float:left; margin:0 0 8px 8px; } #pg ul li a { display:block; width:90px; height:90px; text-decoration:none; border:1px solid #000; } #pg ul li a img { display:block; width:90px; height:90px; border:0; } #pg ul li a:hover { white-space:normal; border-color:#336600; background-color:#323E20; } #pg ul li a:hover img { position:absolute; left: 290px; top:110px; width:300px; height: 300px; border:1px solid #000; } #pg ul li a span {display:none} #pg ul li a:hover span { display:block; position:absolute; left:9px; top:110px; width:270px; height:auto; font-size:12px;color: black; } Hello, I was wondering if anyone could help me get this background image to show up in firefox. It shows up in IE. It's the first #header image. I included the other code in case something is conflicting. *edit... nvm. Hello. I'm nesting inputs within labels to enable me to position the inputs underneath their labels. (I use relative positioning for the labels and absolute positioning to move the inputs underneath and slightly to the right.) For one label I don't want any text to appear. I could use a non-breaking space but I'd ideally like to keep the label but just not show the text. But I can't hide it because it contains the input What would be a good way to approach this? (I've given the label a class to identify it/them.) Code: <form id="myForm" method=""> <label>Email<input type="text" id="txtEMail" /></label> <label>Password<input type="text" id="txtPWord" /></label> <label class=" lblHidden " >Login<input type="image" src="images/login.jpg" id="btnLogin" /></label> </form> [It occurred to me to set the width to 0 but I'm not so keen on this approach and it might interfere with my positioning.] Andy. PS I could post my css if it's useful (?). Edited: width:0px doesn't do anything anyway, because it contains an image. I am very new to css. I am trying to show and hide text by clicking a button. My intention is to use this in a threaded discussion board. For example I'd like the topics to be displyed when the page loads 1) topic 1 (Open/Close) 2) topic 2 (Open/Close) On hitting the Open button this would be something like this: 1) topic 1 (Open/Close) ---message 1 ---message 2 ---message 3 ---message 4 2) topic 2 (Open/Close) Hope someone can suggest me an answer or point me to one. Thanks I am converting my news system from tables to pure CSS. So far its going great, and I'm almost complete except for one problem; Each post has a category, and the category image is displayed in each post using "background-image" in CSS. Although it somehow comes back in the background of each link within the <div> (in Firefox). I have attached an image of what I'm talking about. Here's the html (simplified): Code: <div class="games"> <div class="newstoryinfo"> <h2>Topic goes here</h2> </div> text text text text text text text text text text text text text text text text text text text text text and so on... </div> Here's the CSS Code: .news { background-image: url("/img/topics/1.gif"); background-color: transparent; background-repeat: no-repeat; border: 1px solid black; padding: 10px; } .news div { text-align: justify; margin-left: 1ex; margin-bottom: 10px; padding-left: 60px; padding-right: 5%; line-height: 1.6em; } .newstoryinfo { padding-top: 5px; color: #888; font-size: 11px; font-family: "Lucida Grande", Verdana, Geneva, Lucida, Helvetica, sans-serif; } Can someone please tell me how to make links in the "text text text.." area display with a white/transparent background? Thank you! I m wondering if any body help me out regarding style sheet.. I m using an image as a background in a column of a table... I just want to display the lower portion of tht image while using it as a background..and cut down the upper portion...how can i achieve this in css style sheet? Code: <table width="800" align="center" cellpadding="0" cellspacing="0" style=""> <tr> <td width="800" height="258" STYLE="background-image: url('Images/mega/mega.gif');background-repeat:no-repeat"></td> </tr> </table> Hi there, Was wondering if anyone had a solution with what I am trying to achieve if at all possible. I've been playing with a drop down that opens onclick with pure css. What I am trying to accomplish to have the dropdown close automatically when pointer is not on the dropdown menu. I know this is possible with jQuery but get this, I am trying to accomplish this in pure css. My code is below which is pure css which again works onclick to open the 2nd tab. Again, I am trying to achieve an automatic close behavior such as with a hover but not by using the hover class or javascript. <!doctype html> <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> <!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]--> <!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]--> <!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8"> <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame Remove this if you use the .htaccess --> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <!-- Mobile viewport optimized: j.mp/bplateviewport --> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects --> <script src="js/libs/modernizr-1.7.min.js"></script> <style> div.items ul:not(:target) {display:none;} div.items ul:target {display:block;} .tabs { float:left; clear:none; width:200px; height:30px; border:solid 1px #cccccc; padding:10px; background:#000000; } a { text-decoration:none; } .tabs a { float:left; margin:8px 5px 5px 5px; color:#ffffff; } ul { width:222px; float:left; clear:both; padding:10px 0px 10px 0px; margin:-8px 0px 0px 222px; line-height:35px; list-style:none; } li { border-left:#cccccc solid 1px; border-right:#cccccc solid 1px; border-bottom:#cccccc solid 1px; } ul li a { margin-left:15px; } </style> </head> <body> <!-- Start Tabs --> <div class="tabs"> <a href="#">Dashboard</a> </div> <div class="tabs"> <a href="#item2">Data & Reports</a> </div> <div class="tabs"> <a href="#">Data Archives</a> </div> <!-- End Tabs --> <!-- Start 2nd Tabs Content --> <div class="items"> <ul id="item2"> <li> <a href="#">Sales By Device</a> </li> <li> <a href="#">Delivery</a> </li> <li> <a href="#">Revenue</a> </li> <li> <a href="#">Sales By Purchase Type</a> </li> <li> <a href="#">Data Archives</a> </li> </ul> </div> <!-- End 2nd Tabs Content --> </body> </html> Good Morning All, Been having a slight problem with the visual in the screenshot below. The blue line is our H2, and the purple one is our H3, however, as you can see, the underline spans the entire width of the column, not just underneith the text, which is our requirement. ***As i am not allowed to upload a url as a new user, the underline is as follows. With the text centre aligned. text ----------------------------------------------------------- rather than text ------ and obviously by the css, the underline on the headers is a small image, repeated - x. Please see relevant css information. * (line 23) { margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; padding-top: 0pt; padding-right: 0pt; padding-bottom: 0pt; padding-left: 0pt; } h2, h3, h4, h5, h6 (line 101) { font-size: 1.2em; font-weight: normal; padding-bottom: 4px; margin-top: 0.6em; margin-right: 0pt; margin-bottom: 0.8em; margin-left: 0pt; text-align: center; } .contentArea h2, #secondaryNavigation h2 (line 114) { background-color: transparent; background-image: url("../images/h2_gradient_bg.gif"); background-repeat: repeat-x; background-attachment: scroll; background-position: left bottom; color: #0066cc; } Many Thanks in advance. Marc. Hi. See code below. Why does the outer SPAN in TABLE not grow with the image height. If the text is longer so it is forced below image then it looks as it should. Please also read some comments in the code. Code: <html><body><center><br><br> Why does image not force the outermost span to be at least as high as image?<br> If the text are long enough and gets below the bottom border of image it look good though.<br><br> NOTE: I need to put Image and text either within separate span or in same span as the examples below.<br> In my real application I'm using an <a href=" ...> around the outer span in examples below.<br> <br><br> <table border=1 cellpadding=0 cellspacing=0 width=200px><tr><td> <span style="display:block; background-color:#ffa827; padding-top:10px; padding-left:10px; padding-right:10px;"> <span style="display:block; float:left"> <img src="landscape.jpg" height="40px" width="40px" alt="" border="0"> </span> <span style="display: block; color: white;"> Text here. </span> </span> </td></tr></table> <br><br> <table border=1 cellpadding=0 cellspacing=0 width=200px><tr><td> <span style="display:block; background-color:#ffa827; padding-top:10px; padding-left:10px; padding-right:10px; color: white;"> <img src="landscape.jpg" height="40px" width="40px" alt="" border="0" style="float:left"> Text here. </span> </td></tr></table> </center></body></html> Hi. Really hoping someone can help me with this... I'll try and explain this as best I can(!) Basically I've got a page containing a block of 9 images, with each linking to a video clip. At the moment I've got the CSS coded so that whenever the mouse is hovered over the 'infobar' (at the bottom of each image) it goes from having a transparent background with black text to having a grey background with white text. What I'm trying to achieve is that same effect whenever the mouse is hovered over any part of the image and infobar. The live online link can be found at: www.markmcm.co.uk/test/test.html The CSS is as as follows: Code: /* * Page Stylesheet */ body { font-family: Arial, Helvetica, sans-serif; background-color: #eaeaea; border:0; margin:0; padding:0; height: 100%; } a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } #container { margin-left: auto; margin-right: auto; min-height: 100%; width: 936px; } * html #container { height: 100%; } #content { float:left; position: relative; height: 528px; width: 936px; z-index: 0; } .miniscreen1, .miniscreen2, .miniscreen3, .miniscreen4, .miniscreen5, .miniscreen6, .miniscreen7, .miniscreen8, .miniscreen9 { position: absolute; float: left; display: block; width: 312px; height: 176px; } .miniscreen1 { top: 0; left: 0; } .miniscreen2 { top:0; left: 312px; } .miniscreen3 { top: 0; left: 624px; } .miniscreen4 { left: 0; top:176px; } .miniscreen5 { left: 312px; top:176px; } .miniscreen6 { left: 624px; top:176px; } .miniscreen7 { left: 0; top:352px; } .miniscreen8 { left: 312px; top:352px; } .miniscreen9 { left: 624px; top:352px; } .info { height: 30px; top:3px; left: 40px; width: 265px; float: left; position: absolute; } .infobar { left:0px; position: absolute; top: 140px; width: 312px; height: 36px; outline: none; color:#000; background: url("data/infobar.png") no-repeat 0 0; z-index: 650; } .infobar:hover { background-position: 0 -36px; outline: none; color:#fff; } #infobar span { display: none; outline: none; } .clip_title { outline: none; font-size: 85%; font-weight: 700; vertical-align: top; text-align: left; } .clip_sub { outline: none; height: 13px; font-size: 80%; line-height: 13px; font-weight: 700; vertical-align: top; text-align: left; } And the HTML is: 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"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Test Page</title> <meta name="description" content=" " /> <meta name="keywords" content=" " /> <meta name="generator" content=" " /> <link rel="stylesheet" type="text/css" href="page.css" media="screen" /> </head> <body> <div id="container"> <div id="content"> <span class="miniscreen1"> <a href="#"> <img src="img/clip1.jpg" width="312" height="176" border="0"> <span class="infobar"><span class="info clip_title">Test Clip 1<br><span class="clip_sub">123 Productions</span></span></span></a> </span></span> <span class="miniscreen2"> <a href="#"><img src="img/clip2.jpg" width="312" height="176" border="0"> <span class="infobar"><span class="info clip_title">Test Clip 2<br><span class="clip_sub">123 Productions</span></span></span></a> </span></span> <span class="miniscreen3"> <a href="#"><img src="img/clip3.jpg" width="312" height="176" border="0"> <span class="infobar"><span class="info clip_title">Test Clip 3<br><span class="clip_sub">123 Productions</span></span></span></a> </span></span> <span class="miniscreen4"> <a href="#"><img src="img/clip4.jpg" width="312" height="176" border="0"> <span class="infobar"><span class="info clip_title">Test Clip 4<br><span class="clip_sub">123 Productions</span></span></span></a> </span></span> <span class="miniscreen5"> <a href="#"><img src="img/clip5.jpg" width="312" height="176" border="0"> <span class="infobar"><span class="info clip_title">Test Clip 5<br><span class="clip_sub">123 Productions</span></span></span></a> </span></span> <span class="miniscreen6"> <a href="#"><img src="img/clip6.jpg" width="312" height="176" border="0"> <span class="infobar"><span class="info clip_title">Test Clip 6<br><span class="clip_sub">123 Productions</span></span></span></a> </span></span> <span class="miniscreen7"> <a href="#"><img src="img/clip7.jpg" width="312" height="176" border="0"> <span class="infobar"><span class="info clip_title">Test Clip 7<br><span class="clip_sub">123 Productions</span></span></span></a> </span></span> <span class="miniscreen8"> <a href="#"><img src="img/clip8.jpg" width="312" height="176" border="0"> <span class="infobar"><span class="info clip_title">Test Clip 8<br><span class="clip_sub">123 Productions</span></span></span></a> </span></span> <span class="miniscreen9"> <a href="#"><img src="img/clip9.jpg" width="312" height="176" border="0"> <span class="infobar"><span class="info clip_title">Test Clip 9<br><span class="clip_sub">123 Productions</span></span></span></a> </span></span> </div> </div> </body> </html> There must be a better (and easier?) way to do this. Any help would be very-much appreciated - and save an old bloke from tearing too much of his hair out(!) Hi I am redesigning my blog and took it down completely. I want to place the day's text post on the day's photo post on top of the latter, while graying out the photo. Is that possible without using flash? Figured this was simple, but I can't seem to figure it out. Using CSS, I want to put an image on the left with text to the right aligned to the bottom. I could easily do this with a table, but I'd like to find a CSS way. With CSS like: .imginfo {float:none;clear:both;margin-top:1em;} .imginfo img {float:left;margin-right:1em;} and code like: Code: <div class="imginfo"> <img src="..." /> Line of Text<br /> Line of Text<br /> Line of Text<br /> </div> I get the image on the left and the text on the right, but, the text starts at the top of the image. I want it to end up aligned to the bottom of the image. Attempting to use vertical-align: bottom doesn't do anything with the text. The effect I am looking for is like below. If you assume the XXX are the image... Code: XXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXX Line of Text XXXXXXXXXXXX Line of Text XXXXXXXXXXXX Line of Text Hi, not sure if it is possible but i thought it may be possible in CSS... I was wondering: * I have a shopping cart (using JS) * A CSS based Navigation which is "View Shopping Cart" * An form button called "Add to cart" ** I want the CSS based Nav, to be hidden, until the user clicks on the form button, then it is visible, so that the user can click on it... Anyone know how this is done??? Cheers Jackson Hello. So I have this situation (on the right): h t t p : / / img339.imageshack.us/img339/6958/1stb.png and when I change my browser resolution, I get this (on the right): h t t p : / / img35.imageshack.us/img35/3892/2ndhw.png Is it possible to do that the image wouldn't change the place on a screen even you when change the resolution of the browser? And yes, the image must be behind the text. Thanks in advance for any suggestions and tips. I am trying to put labels below images on my new site design. See: www.jwsuretybonds*com/jw09 I figured out how to get them vertically aligned, but I am having problems with the horizontal, as when I change the browser size, they move. Here is one of the examples: Code: #homepage-bar h2.construction { position:fixed; top:225px; left:505px; } I tried changing to position: absolute; I also tried to use percentages on the left: I know this is easy, but I can't find the fix after googling for 30 minutes. Help! Hi, Here is the page I am having trouble with: http://mccalebconstruction.anchorwave.com/slices/index2.php If you view source, the CSS should be in the file as well. It is very basic because I have stripped out everything else on the page to make it simpler to identify the problem. But I don't know what the problem is! In Firefox it looks fine. In IE there is a line on the left of the content area. The line is caused by the background-image of #content. I don't understand why it's showing up, though, since the images are supposed to be floating left (thus, covering the background image)... but it appears they aren't floating ALL THE WAY to the left, there is a gap. I made sure all the padding and stuff was 0 but that doesn't help. Thanks in advance, ~wz Hey Guys, Im kinda stuck, my site here -beta.thenpcs.com just displays the backround in IE6. The CSS validates so im not sure what im doing wrong :/ Thanks! What is the css to make it so text sits next to an image rather than automatically being placed underneath. Im not really sure how to explain it. I do know that before i made use of hspace and align to make it work... Hello all, I have this code that works well on IE and not on FF , I simple want to have the text to have a background image. Code: <img style="position:absolute; z-index:0;" src="images1.gif" alt="" /> <p style="position:absolute; z-index:1"> <% response.Write("This text has a background image from images1.gif") %> </p> I'm trying to do a layout like this: wink zone. net / ap.jpg I know how to do the header part of it but the end of the image of the person and the text parts are bit harder. Could you give me some help? I guess the best way to do this is use floats? |