473,394 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Absolute positioning an image (button)

Ok guys, I'm still new at all this but I recently did a site and was able to amke the contact button stay in place. I copied the code and used it in a new site and now it moves around when I resize the browser window. I'm not sure what I've done wrong but I'll post the CSS if you wouldn't mind taking a look at it please.

You'll see in the .floatlink the image I am trying to use. I'd post this on the web for you guys but the server and host are not up yet.

/* CSS Document */

/* -------------- Basics --------------------------- */
Expand|Select|Wrap|Line Numbers
  1. body {
  2. margin: 15px 0 15px 0;
  3. padding: 0;
  4. min-width: 800px;
  5. color: black;
  6. font:11px "Lucida Grande", Arial, sans-serif;
  7. background-color: #B3D2D7;
  8. margin: 10px 0 50px 0;
  10. }
  13. #wrapper {
  14.     text-align: left;
  15.     width: 800px;
  16.     margin-left: auto;
  17.     margin-right: auto;
  18.     background-color: white;
  19.     padding: 10px;
  20.     border: 5px solid grey;
  21. }
  24. .floatlink {
  25. width:326px;
  26. position: absolute;
  27. top: 0px;
  28. right: 10px;
  29. display: inline;
  30. overflow:hidden;
  31. padding-top: 10px;
  32. }
  34. .floatlink a {
  35. padding: 0px;
  36. height: 25px;
  37. width: 100px;
  38. display:block;
  39. background-image: url(images/contact_button.jpg);
  40. background-repeat:no-repeat;
  41. }
  43. #header {
  44.     width: 775px;
  45.     height: 200px;
  46.     padding: 0;
  47.     background: url(ib_header.gif) center;
  48.     background-repeat: no-repeat;
  49.     border: 3px;
  50.     background-color: #CCCCCC;
  51. }
  53. #header h1 {
  54.     color: #B3D2D7;
  55.     margin: 0 ;
  56.     padding: 0 ;    
  57.     text-indent: -9000px;
  58. }
  60. #content {
  61.     background-color: white;
  62.     padding: 20px;
  63. }
  65. #content h1 {
  66.     font-size: 105%;
  67.     color: black;
  68.     text-align: center;
  69.     padding: 5px;
  70.     background: url(images/bar.jpg);
  72. }    
  74. #content h2 {
  75.     font-size: 95%;
  76.     color: black;
  77.     text-align: center;
  78.     padding: 10px 5px 10px 5px;
  79.     margin: 40px 5px 20px 5px;
  80.     background: url(images/bar.jpg);
  81.     }
  83. #content h3 {
  84.     font-size: 90%;
  86. .special {
  87.     font-size: 105%;
  88.     color: black;
  89.     }
  91. img {
  92.     padding: 0 10px 10px 0;
  93.     border:0;
  94.     }
Nov 9 '07 #1
2 5283
oops, I just noticed I posted the code with an absolute z-index positioning on it, which stuck the image in place and not on the page right anyway. Sorry bout that, but I just fixed it...
Nov 9 '07 #2
well, I figured it out.... thank to those who looked at this though.
Nov 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Ken Kast | last post by:
Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I...
by: Gustaf Liljegren | last post by:
Here's what I'm trying to achieve: 1. A <div>, centered on screen, 600px wide and 100px high, with a background-image (also 600 x 100). 2. Text (an <h1> element) positioned with precision inside...
by: JKenyon | last post by:
I am attempting to display two images on a web page. The second "image" is actually two images, one overlaid on the other. The first one is aligned on the left using float:left. I have enclosed...
by: xtort | last post by:
My question is: If you create a template in Photoshop, slice it in ImageReady, using the CSS output option(under the "slices" menu in "output--options"), and then use the CSS output for a...
by: nonsensitor | last post by:
I'm just learning xhtml & css, primarily from westciv's online tutorials and css guide. I've run into a couple of problems with a page I'm developing that I can't figure out. The first problem is...
by: nino9stars | last post by:
Hello, I have just started messing with absolute positioning on webpages, and it definitely let's you do some creative things. Well, after much searching and help, I got the images I was using...
by: goldenboy651 | last post by:
My Positioning in IE 6 is exactly the way I want it, but when I view the page in my firefox browser things are out of place. When I try and change the css my IE page moves, but the firefox doesn't. ...
by: Mark | last post by:
hi, i'm trying to position something in the top right corner of a container, but i can't seem to figure out how to get it working. here's the html <div class='thumb'><a href='image.jpg'><img...
by: sknonline | last post by:
Greetings. I am having troubles using absolute positioning in IE6. When I establish the width as 100%, it's not spanning the entire width of the browser. It works in Firefox, Safari, and IE7.......
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.