473,385 Members | 1,769 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,385 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;
  9.  
  10. }
  11.  
  12.  
  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. }
  22.  
  23.  
  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. }
  33.  
  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. }
  42.  
  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. }
  52.  
  53. #header h1 {
  54.     color: #B3D2D7;
  55.     margin: 0 ;
  56.     padding: 0 ;    
  57.     text-indent: -9000px;
  58. }
  59.  
  60. #content {
  61.     background-color: white;
  62.     padding: 20px;
  63. }
  64.  
  65. #content h1 {
  66.     font-size: 105%;
  67.     color: black;
  68.     text-align: center;
  69.     padding: 5px;
  70.     background: url(images/bar.jpg);
  71.  
  72. }    
  73.  
  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.     }
  82.  
  83. #content h3 {
  84.     font-size: 90%;
  85.  
  86. .special {
  87.     font-size: 105%;
  88.     color: black;
  89.     }
  90.  
  91. img {
  92.     padding: 0 10px 10px 0;
  93.     border:0;
  94.     }
Nov 9 '07 #1
2 5282
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

4
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...
6
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...
1
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...
4
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...
2
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...
2
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...
3
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. ...
6
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...
0
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.......
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.