CSS - Floating Banner Through Forum
Similar TutorialsI'm trying to figure out a way to create a banner across the top that consists of an image, but whose right edge extends all the way to the right edge of the browser -- regardless of the window size. At the same time, I need to do the same thing with the left column: fill it with an image whose bottom edge extends all the way to the bottom of the window. I can do this with tables, but can't figure out a cross-browser way to do it in CSS. The "stretchy" right edge of the banner is simply a 1 pixel wide slice of the banner's right edge, repeated as necessary. Similarly, the "stretchy" bottom of the left column is a 1 pixel slice of the bottom of the column's image. I can't get these to appear in Mozilla. Here's my code: Styles.css: PHP Code: .banner { background-image:url(./images/banner-fill.gif); width:100%; } .nav { background-image:url(./images/nav-fill.gif); width:104px; height:100%; } .content { position:absolute; left:140px; top:140px; } Template.htm: PHP Code: <html> <head> <title>Template</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="css/styles.css"> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="height:100%;width:100%"> <div class="banner"><img src="images/banner.jpg" width="800" height="134" border="0"></div> <div class="nav"><img src="images/nav.jpg" width="104" height="327" border="0"></div> <div class="content"> <p>Page Content</p> </div> </body> </html> hmm i cant get this to work... i have the left side of the banner that needs to be expandable wich is a long picture.....and the right side is 10px wide. how can i get this 2 in a div wich get width by % and center aligned on the page? and also on a layer above other stuff Hi there, I have the following in my css file: } #headerBannerWrapper { background-image: url(/GREENLOGO.jpg); background-position: bottom left; background-repeat: no-repeat; background-color: #DEF2B0; padding: 0px; margin: 0px; } #headerBannerWrapper img { padding: 0px; margin: 0px; vertical-align: bottom; However the banner doesn't get rendered in IE7. It renders OK in IE8 Any help most appreciated. The above is linked to the following class: .clearFix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; NB If the banner has content inside then it renders OK, however if there is no contents inside then the banner (green background) is not displayed. Hi and thank you in advance for any advice or help. my website: http://earlystartdc.com/ Im having trouble trying to find the right css code so that i can adjust the banner underneath the menu in order to remove the white spaces in the module. I would like for the banner to be at margin 0 so that its all the way to the top without any white space in between. any help?? Thank you P.s - This is what my css files look like from my template/css folder . With all the hype these days about finally meeting CSS specs and designing without tables, I think this topic needs more focus. What do you think? Hi, I need to add some content (small div) over the top of a flash banner. I tried adding wmode="transparent" to both the object and embed tag but that didnt work. Any other suggestions? thanks Hi, I just installed Gallery on my website, and I'm trying to integrate it with the main theme of the rest of the site. Well I'm having a problem with the banner overlapping the logo in FireFox. It renders fine in IE7 (surprisingly), but not in FF. Have a look he http://www.lightblu.com/gallery/main.php un/pass: test/test You can look at how I want it on the homepage, or anywhere else for that matter. What am I doing wrong? I tried everything with no success. Thanks guys --Waj I've been away for nearly three months and may have forgotten some of the basics of CSS. Today I added a banner photo to the top of my new bike club site, but cannot remember how to style it so that, when a visitor adjusts the width of their browser window, the banner photo sidles to the left or right to remain centered at the top of their window, along with the the bike club name and pull-down menus immediately below (see http://stallinswebdesign.com/vs/index.php). Can you suggest how I can style that banner photo so that it remains centered whenever a visitor stretches their browser window? I know you can view source to view my <div> structure and so forth; let me know if you'd like to see any parts of my style sheet. Thank you for your valuable time. Curtis Hi everyone, I've been playing around with this for a while but I can't seem to get it to work. Basically, I'm trying to get this table effect in CSS layers. Code: <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="#669999"> <td width="580">Welcome</td> <td> <div align="right"><img src="images/bg_dblue_gradient.gif" width="200" height="25"></div> </td> </tr> </table> It's basicly a 2 column layout, with the left column being some kind of content and the right column being a gradient graphic I made, to make the banner look like it has a full gradient. The gradient graphic is 200px wide, thus one resizing of the browser the table in a whole won't shrink down past 780 pixels. I want to use a <div> tag for the graphic so I can repeat-y and have the gradient appear fluid if someone resizes the text size. Any suggestions? Cheers, Fozzy i am writing a site for fun to learn how websites work. The site i write right now will be like a school newspaper. I have one problem with the background, at the begining i couldnt make it no repeat but later i did it, now, i got something wrong with my code. PLease help me here is my code: ( i mean that the back ground color does not appear!! Code: <html> <head> <title> blah blah </title> </head> <body bcolor="#004d79"> <center> <img src="/pics/banner.png"> </center> <h4> <b> <center> blah blah </center> </b> </h4> <style type="text/css"> <!-- body {background-image: url(pics/background.png); background-repeat: no-repeat;}set to background-repeat: no-repeat;background-position:center; </style> <center> <b> (C) blah blah </b> </center> <center> <div style="position:absolute;top:130px;left:375px"> <h1> <b> <p> Our website is under construction!!<br>Thank you for visiting us!! </p> </b> </center> </h1> </div> <div style="position:absolute;top:250px;left:260px"> <b> <p> blah blah </p> </b> </center> </div> </html> Thanks alot, J. I would like to post on another forum with CSS. Is there any way to do this? I already have the content laid out with css in my html editor and just wanna transfer it to a forum as a forum post. I suspect forums don't allow css so just wondering if there's a way around this. Appreciate the help, JH Hello all - I am trying to implement tabs to my forum, I currently have some on there but I like the looks better of the new ones that I am trying to get going. I find that when I get them working (using additional CSS as well as navbar/header edit) it will not work in all browsers. If I post the CSS as well as the navbar/header code would you be able to help me track down my issue? EDIT - I was going to post screenshots but was not permitted I like the way this liquid banner degrades as the browser is narrowed. Is this the preferred way to accomplish this effect? I like the way the overflow: hidden attribute causes objects to basically disappear rather than force the banner div to be taller as content shifts. If you could please pick this apart I would appreciate it before I update 500 product pages with it. For testing purposes I have simply styled the html tags directly. When I get it right I'll make it external. Code: <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"></meta> </meta> </head> <body bgcolor="#ffffff" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0" style="overflow: auto"> <div style="border: 1px solid gray; text-align: center; height: 72px; background: white url(site_images/share_logo_header_middle.gif) repeat-x; overflow: hidden"> <div style="float: left; margin-top: 0px"><img src="site_images/share_logo_header_left.gif" alt=""></img></div> <div style="float: right; margin-top: 0px"><img src="site_images/share_logo_header_right.gif" alt=""></img></div><h1 style = "font: 1em/1.2 Verdana, Arial, Helvetica, sans-serif; color: navy; font-size: 1em; margin-top: 0px; line-height: 40px">The finest Specialty Chemical Products Since 1971</h1> </div> <div>Content is king </div> </body> </html> See the page here. As I'm writing this thread I see that I need to clean up a few unneeded declarations in the css - please disregard. Thanks for looking, Rob Hi all, I'm working on a header which I'm having trouble with. Here's a crude diagram of what I'm looking to accomplish: Code: ____________ _______________________| |___ | _____________________| Logo |_ | | | |___________| | | | | Banner | | | |___________________________________| | | | | | <-- container div Uhhh, hopefully you can see what I'm getting at! I want a logo to be positioned on top of the banner image, but offset above and to the right, outside the container div holding the banner. Note also that the container div is centered in the page, so that the relative amount of space on either side of the container div increases and decreases with the browser window. Approaches I've tried: (1) Use position:absolute for the logo. The problem here is the horizontal position. Regardless of what I've tried, the logo moves horizontally with the size of the window. I want the logo fixed relative to the container div. (2) I've tried to use negative margins and place the logo inside the container div, but this doesn't seem to work either. How should I do this? All suggestions welcome. Thanks! Hi there, I'm working on a site on behalf of a charity (non profit social enterprise) www.ableradio.com What I am trying to do is make the banner fit on screen, and stay centred when users resize the page (or have diffrent resolution). The site is a joomla based site, so i am constricted to making changes only to the css files. currently this is the css that governs the banner; Code: #gk-mainnav{ width: 977px; height: 80px; position: reletive; padding:7px 0 0 0; background:transparent rl('../images/menu_bg_top.png') no-repeat right top; padding-bottom:100px; } #gk-mainnav2{ height:50px; width:977; line-height:39px; font-size:90%;font-weight:bold; text-transform:uppercase; padding:0 20px; margin-top:100px; } Basically, i have replaced menu_bg_top.png with our banner, and a space for the menu bar to sit on top of it. The problem is, if your running an 800x600 resolution then the banner is cropped to fit rather than resized. Idealy the banner should resize and fit the width of the screen, but if this cannot be possible, then keeping it centred will suffice (holding ctrl+mouse wheel down to zoom out, shows how the banner doesn't resize, AND how it doesn't center). If i could find the main php file from which joomla creates each page i could insert the code there with some java script that resizes the image based on resolution etc... but i am limited to the style sheets only. Thanks for any help ^_- Take care, Steve. Hi, I want to place a Logo and Banner in the header using CSS, i tried this but no use its not working properly. PHP Code: div#main #header{ width:100%; height:95px; text-align: center; background:url(images/top_bg.jpg); } div#header #header_title{ text-align:left; font-family: Arial, Helvetica, sans-serif; font-size:25px; color:#ffffff; padding-left:20px; padding-top:20px; } div#header #header_title #banner{ text-align:right; width:468px; height:60px; background:url(images/banner.jpg); background-repeat: no-repeat; padding-right:20px; padding-bottom:20px; } Then i used this in html PHP Code: <div id="page"> <div id="header"> <div id="header_title"> Your Logo <div id="google"></div> </div> </div> But its not working properly, please please please help me....thanks... vinodkv My content and navigation bars, though set to 100%, are actually 100% (of the body/html element) plus 100 pixels (their "top" property). If I set their "top" property to 0, they fit the page perfectly but I need them below the title banner. Is there a way to make the 100% height value of these two columns relative to the fixed height of the title banner? Note: One solution was to set their "bottom" properties to 0px. This does not work in IE so it's not a valid option. Also, I do not have the option of setting the navigation's and content's divs to a "top" value of 0 and rasing the title banner's z-index to cover them as I need the overflow scroll bars to extend from the bottom of the title banner to the bottom of the page and not from the top of the page to the bottom of the page. (think frameset ) Code: <!DOCTYPE PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>100% Height - CSS Problem</title> <style> html { height:100%; } body { height:100%; padding:0px; margin:0px; background-color:#CCCCCC; } #title_banner { display:block; position:absolute; width:600px; height:100px; left:0px; top:0px; background-color:#CC6666; } #navigation { display:block; position:absolute; width:140px; height:100%; left:0px; top:100px; background-color:#66CC66; overflow:auto; } #page { display:block; position:absolute; top:100px; left:140px; width:460px; height:100%; background-color:#6666CC; overflow:auto; } </style> </head> <body> <div id="title_banner"> Set width and heighth title banner image. </div> <div id="navigation"> Navigation links. </div> <div id="page"> Page content. </div> </body> </html> I'd appreciate any links you can share as well. All of the tutorials I've seen for 100% high pages do not include a horizontal, fixed-height banner across the top. |