CSS - How To Keep An Background Image Move With My Twitter Feed.
Hello!
I have the site (w w w . s t e f a n t r e g o . c o m /wordpress) ... and I am trying to place a tv graphic I made under my twitter feed as an aesthetic effect. Currently I have: body { background-image:url('/Images/tregotv.jpg'); background-repeat:no-repeat; background-attachment:fixed; background-position:983px 400px; display:block; } This looks fine on my computer -- BUT -- when I go to my photo section, travels section, the format of the site changes. Therefore my background image and twitter feed don't align correctly. Is there any CSS way to correctly align the background image to always be positioned under my twitter feed without format issues? Or would I need to get assistance with an alternate code such as Java script, or PHP to position the picture so the twitter feed always fits inside the tv? I appreciate the help!! -Stefan twitter: @stefantrego w w w . stefantrego . c o m / w o r d p r e s s PS. Sorry for the spaced out web addresses -- due to being a new user I cannot post links right away. Similar TutorialsHello, I am running wordpress and I have a Twitter Widget known as Twitter Widget Pro. What I've done is that I made a graphic (a little TV with a twitter bird on top) to serve as a background image but be positioned right behind my Twitter widget so the twitter feed fits inside the tv. I got this positioned correctly on the front page in my style.css sheet. But as I go to my other pages: photos, travels, etc. the format of my site changes and therefore the background image (tv) and the Twitter feed don't align properly. How can I code the background image of the tv and the twitter widget to align properly together on all my pages? Would I have to insert the image into the actual twitter-widget-pro code itself? My website is: (w w w.stefantrego.com) Thanks a lot for the help! -Stefan Hi, Hope you can help. I'm having trouble trying to figure out why the links in my twitter feed have the same Background color thats applyed to my navbar. (#9933CC. I'm certain I isolated the CSS to affect only the navbar. For some reason its affecting the twitter feed and I can work out why. Can you help?? My site is below. www. smartbod co.uk (Delete spaces in url as I cant post link as im new) Thanks in advance David My code works well in Internet Explorer and Safari but it does not work the way I want it to in Firefox and Opera. My items with red borders should always stay close to the blue bar in the background. But in Firefox and Opera the body background moves to the left when the window size is small, and the items with red borders appear to move away from the blue bar. The problem is the way in which these browsers center the background image for the body. Can anyone help me fix this issue? Thanks! Code: <!DOCTYPE html 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"> <head> <title>Demo</title> <style type="text/css" media="all"> html, body { padding: 0px; margin: 0px; height: 100%; width: 100%; text-align: center; } body { background: #555 url(http://www.glidestor.co.uk/images/PageBackground.gif) repeat-y scroll 50% 0; color: #111; } #page { width: 617px; margin: 0 auto 0 auto; padding: 0 0 0 160px; text-align: left; position: relative; border: 1px solid #55aa77; } #homeFeatures { margin: 420px 0 0 0; } #homeFeatures #f1, #homeFeatures #f2, #homeFeatures #f3 { padding: 0 40px 0 12px; font-size: 9pt; font-weight: 300; width: 200px; display: block; text-decoration: none; float: left; border: 1px solid red; } </style> </head> <body> <div id="page"> <div id="homeFeatures"> <a href="#" title="Item 1" id="f1"><strong>Item 1</strong>J khfdg jkfkfhkjfsh ksh fhdk ghjkhfsdkjg hsdfjkhsdfjkkjsdf hgkjfsd hgkjfdh gkjfh kjghkjfdh kfj hkfjd hfkdjg hk jghfsdkj ghfsdjk hgfjdhg jsdfgh sdfj ghf.<span>more</span></a> <a href="#" title="Pring Design" id="f2"><strong>Item 2</strong>T khfdg jkfkfhkjfsh ksh fhdk ghjkhfsdkjg hsdfjkhsdfjkkjsdf hgkjfsd hgkjfdh gkjfh kjghkjfdh kfj hkfjd hfkdjg hk jghfsdkj ghfsdjk hgfjdhg jsdfgh sdfj ghf.<span>more</span></a> <a href="#" title="Item 3" id="f3"><strong>Item 3</strong>B khfdg jkfkfhkjfsh ksh fhdk ghjkhfsdkjg hsdfjkhsdfjkkjsdf hgkjfsd hgkjfdh gkjfh kjghkjfdh kfj hkfjd hfkdjg hk jghfsdkj ghfsdjk hgfjdhg jsdfgh sdfj ghf.<span>more</span></a> </div> </div> </body> </html> 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. Hello. I am trying to center the text in my right column menu found at http://www.invisionshosting.com/v2/terms_of_service.php If you take a look, you will see that the h2 (title bar) as well as each button has the text positioned at the top, and I need the text positioned in the center. I have tried padding-top: 5px; to position the text to the center, but just as I thought it would do, it moves the background down as well, causing a gap to form between each element. I need each button, including the title, to remain with a tight fit as it is now while positioning the text in the center. The CSS I am using is as follows: Code: #menu_right { width: 200px; color: #702208; font-family: Arial, verdana, san-serif; list-style: none; padding: 0 0 0 2px; margin: 0; font-size: 11px; } #menu_right h2 { color:#ffffff; background-image: url(../images/right_column_header.png); background-repeat: no-repeat; width: 200px; height: 28px; text-indent: 10px; } #menu_right ul { margin: 0; padding: 0; list-style-type: none; width: 200px; /* Main Menu Item widths */ } .button_main_1 { /* For Rest State */ background-image:url(../images/right_column_button_off.jpg); background-repeat: no-repeat; width: 200px; height: 28px; color: #ffe7b8; text-indent: 30px; font-size: 13px; } .button_main_1 ul li { position: relative; } .button_main_1 a { /* For Rest State */ width: 200px; height: 28px; display: block; color: #236a9d; text-decoration: none; } .button_main_1 a:hover { /* For Rest State */ background-image:url(../images/right_column_button_over.jpg); background-repeat: no-repeat; width: 200px; height: 28px; display: block; color: #ffffff; text-decoration: none; } The HTML is as follows: Code: <div id="menu_right"> <h2 class="menu_left">Title</h2> <ul class="button_main_1"> <li class="button_main_1"><a href="#">Button</a></li> <li class="button_main_1"><a href="#">Button</a></li> <li class="button_main_1"><a href="#">Button</a></li> <li class="button_main_1"><a href="#">Button</a></li> <li class="button_main_1"><a href="#">Button</a></li> </ul> </div> Hi, Av been having a lot of problems with my drop down working in IE since I added the flash fade to the images. Can anyone point me to the code that is responsible for keeping the drop down menu at the top of the header image.. How can I change it to make it at the bottom? Thanks This is in the header section Code: <!--[if IE]> <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/ie.css" /> <![endif]--> <!--[if IE 6]> <script type="text/javascript">// the Suckerfish script inserts class=sfhover on all li inside id=nav on mouseover sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); </script> <style type="text/css"> #outer { width:1000px; /* Fallback width if javascript is off */ width: expression( (document.documentElement.clientWidth > 1152)? "1150px" : (document.documentElement.clientWidth < 702) ? "700px" : "auto");} </style> <![endif]--> <?php wp_head(); ?> I.E css Code: #header-image { float: left; width: 100%; height: 383px; background-repeat: no-repeat; background-position: left top; background-color: #FFFFFF; margin-bottom: 20px; } Main stylesheet Code: #nav li { position:relative; /* establish stacking context for the AP'd dropdown sublist */ float:right; padding:0; line-height:1.75em; } #nav li a { float:left; padding:0 .5em; border-right: 1px solid #333; color: #CCCCCC; text-decoration: none; } #nav li a.first {border:none;} #nav li:hover, #nav li.sfhover{ background:black;/* background for all links on hover */ visibility:visible;/* makes IE7 think something changes on hover, fixes IE sticking dropdown */ } #nav li:hover a, #nav li.sfhover a {color:#FFF}/*1st level font color on hover*/ /*=== All Sublist Styles ===*/ #nav ul { position:absolute; /* position the sublist to nearest positioned ancestor, the (#nav li) in this case*/ width:12em; /*150px*/ margin-left:-999em;/* hide the sublist */ padding:0; left:0; /* IE6/7 need this to position the sublist correctly on hover*/ top:1.75em; background: url(fake-image.jpg);/* IE needs some sort of BG on the nested ul */ } #nav li li { float: none;/*reset the float from #nav li*/ display:block; height:auto; line-height:1.5; border:none;/*reset borders from #nav li*/ } #nav li li a { float: none;/*reset the float from #nav li*/ display:block; width:11em;/*IE6 needs a width (12em total with padding)*/ padding:0 .5em; border:0; } * html #nav li li a {display:inline-block;} /*hide an overflow bug in IE6*/ *+html #nav li li a {display:inline-block;} /*hide same overflow bug in IE7*/ /*=== Hide All Sublists ===*/ #nav li:hover ul, #nav li.sfhover ul { margin-left:-999em; } /*=== Sublist Font Colors ===*/ #nav li:hover li a, #nav li.sfhover li a {color:#000;} /*2nd level font color*/ #nav li li:hover a, #nav li li.sfhover a {color:#FFF;} /*2nd level font color on hover*/ /*=== Second Level UL position on hover ===*/ #nav li:hover ul, #nav li.sfhover ul { margin-left: 0; /* show the sublist (line up with left border on main list items)*/ } label.screen-reader-text { display: none; } .avatar { display:none; } thanks Hobby Helper Model Trains The above link is where my problem is... If you look at the middle column running down the page, there are several text links that I have the CSS working nice with the background color changing to orange. There is an arrow image that should follow the mouse as I run over these text links, but can't figure out how to get the darn thing to move. Any help will be GREAT!! THANKS! 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. 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, I have a question about setting up the Body background-image via a linked external stylesheet. I have a index.html file and a myStyle.css file. I want to setup the background to load an image file, test.JPG. When I embed the following in my index.html, I see the background show up: ** inside index.html file ** <BODY STYLE="background-image: url(test.JPG);"> blah </BODY> BUT, when I define my background in the externally linked myStyle.css file, the background does not load: ** inside myStyle.css file ** BODY { background-image: url(test.JPG); } ** inside index.html file ** <LINK REL="stylesheet" TYPE="text/css" HREF="myStyle.css"> <BODY> blah </BODY> </LINK> Please help. thanks! 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? Code: div.top { border: 10px solid #CCCCCC; border-bottom-width: 0px; padding: 0px; background-image: url(menutile.jpg); } The code above yields this . It is uneven with the normal image, though both are the same size. I simply want to tile the bg image to the border even with the normal menu images. What am I doing wrong? I'm trying to create a little background image for each image on this page. A kind of crappy looking polaroid type background image. It works fine in Firefox, but not in IE. Any ideas? http://www.rhizaowns.com/holly/index.php 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! I want to use php to get images from a database and display them as css background-image attributes I know that the css Code: #id { background-image: url ('path/file'); } works (obviously) and the html Code: <img src='image-generator-script.php'> also works but the css Code: #id { background-image: url ('image-generator-script.php'); } doesn't work for me. It seems as though it should work. Why place such a seemingly arbitrary limitation on CSS as only being able to display images from existing files? I've done lots of searching through documentation and on forums, but not found anything conclusive either way. A couple of people have said it works. But it doesn't for me. Is there some extra configuration step I'm missing? Does anyone know for a fact that it works? -- so I can know for sure that somewhere I'm making a blunder in my code. But the code is simple, and I don't see where it could go wrong. (As is always the case!!) I can see the image in the browser just by pasting in the script link to the address bar. I know that url() specifiers are relative to the location of the stylesheet, not the html document, but in this case the html, the css, and the php are all in the same directory. I can't see what I could be doing wrong, so it really looks like you can't do it. But why?? And why isn't it mentioned in the documentation? (At least in the placers I've looked.) If you store all your images in a database, how on earth can you display any of them in CSS except by using a script in the url() specifier? I've seen plenty of tips about generating css files from php (I already do it), but that won't help in this case. All I can think of is to have php write the image data from the database into a temporary file, and put that file name into the url() specifier. But what a horrible kludge!! I will be very grateful to anyone who can give me solid facts on this question. Andrew Blake I'm having a lot of trouble with a background image that I want to cover my middle column. It fits perfectly in IE, but in FF, it repeats horizontally, so I put a repeat for only the y, and it's way too thin... Here's my code: Code: body { background-color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; margin:0px 0px 0px 0px; height: 100%; } #header { background-color:#000000; height: 150px; } #leftbox { float:left; width:15%; font-color: black; background-image: url('/images/dkredblk.gif'); } #rightbox { float:right; width:16%; background-color:#000000; } #middlebox { margin-right:16.5%; margin-left:15.5%; margin-bottom: -18px; margin-top: -18px; font-color: brown; background-image: url('../images/membersbackground.gif'); background-repeat: repeat-y; } #footer { position: static; clear: both; background-size: 100%; background-color:#000000; color: red; } Now I've been told that you can't stretch background images in CSS at the moment, so how could I make this background image go in my middle column without repeating on teh x axis but repeating as far as the content needs on the y axis? Hi there, I have a background image defined in my style sheet, but it appears around 1 - 2px to the left more in FF than in IE 7. I have all margins set to 0px. Does anyone know what else could be causing this? Many thanks! I'm trying to make a td change it's background when you rollover the link within it. This code seems ok to me, but I'm not having any luck with the rollover effect. Can any experts take a look? .nav{ background-image:url('images/topmenu/blacknav.jpg'); } .nav a{ font:12px Verdana, Arial, Helvetica, sans-serif; color:#fff; display: block; font-weight:bolder; text-decoration:none; text-align:center; } td.nav a:hover { background-image:url('images/topmenu/nav_highlight.jpg'); } |