473,385 Members | 1,569 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.

Dont move the background with it

Thew
69
Expand|Select|Wrap|Line Numbers
  1. #adv {
  2.     top:0;
  3.     float:left;
  4.     border:1px solid black;
  5. }
  6.  
I have this div. But i have another div ( the main div ) but that moves to the right when i add this script. How can the main div stay on his normal place, when adding this div too?
Sep 7 '10 #1
5 1914
dlite922
1,584 Expert 1GB
let's see the relevant HTML and CSS code. Post the relevant elements as they appear on the page and the css that are applied to those.

If your page is crowded, then create a test.html and recreate/isolate this problem for us. this is also good for your troubleshooting.


Dan
Sep 14 '10 #2
Thew
69
Like this is my CSS:

Expand|Select|Wrap|Line Numbers
  1. body {
  2.     background-color:#F7F5F6;
  3.     margin:0px;
  4.     font-family:tahoma,arial,helvetica,sans-serif;
  5.     text-align:center;
  6. }
  7. a {
  8.     color:#000000;
  9.     text-decoration:none;
  10. }
  11. a:hover {
  12.     color:#000000;
  13.     text-decoration:underline;
  14. }
  15. p.spotreason {
  16.     font-size:12px;
  17. }
  18. #main {
  19.     width:600px;
  20.     background-color:white;
  21.     border:3px solid black;
  22.     margin: 0 auto;
  23.     z-index:2;
  24. }
  25. #mainmenuheader {
  26.     background-color:#c8d7e3;
  27.     width:550px;
  28.     border:1px solid black;
  29. }
  30. #mainmenu {
  31.     background-color:white;
  32.     width:550px;
  33. }
  34. #mainmenu a {
  35.     font-size:12px;
  36. }
  37. #ga_block { width: 300px; background-color: #ffffff}
  38.     #ga_block img { display: block; border: none; }
  39.     #ga_block #ga_title { font: normal 12px Verdana, sans-serif; border: none; margin: 4px 0 0 0; }
  40.     #ga_block #ga_title a { text-decoration: none; color: #1389B7; }
  41.     #ga_block #ga_text { font: normal 11px Arial, sans-serif; border: none; margin: 4px 0 0 0; width: 100%; overflow: auto; }
  42.     #ga_block #ga_text a { text-decoration: none; color: #000000 }
  43.     #ga_block #ga_text p { margin: 4px 0; }
  44.     #ga_block #ga_text img { display: block; position: relative; float: left; border: none; margin: 0 1em 1em 0; }
  45.  
  46. #adv {
  47.     top:0;
  48.     float:left;
  49.     border:1px solid black;
  50.     z-index:1;
  51. }
  52.  
and this is my code:

Expand|Select|Wrap|Line Numbers
  1. <div id="adv" style="display:inline;">
  2. ...
  3. <!--This is the div that moves the div main.-->
  4. ...
  5. </div>
  6. <br/>
  7. <div id="main">
  8. ...
  9. </div>
  10. </body>
  11. </html>
  12.  
Sep 16 '10 #3
Have you tried to remove the <br /> from this:
Expand|Select|Wrap|Line Numbers
  1. </div>
  2. <br/>
  3. <div id="main">
Sep 16 '10 #4
Thew
69
Still the same
Sep 17 '10 #5
The <div id="main"> is currently and always on the center even if you add the <div id="adv">, so what exactly you want to do? I don't see it moving to the right.
Sep 18 '10 #6

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

Similar topics

0
by: Silvio Malitsch | last post by:
Hello, I have some trouble with designing my GUI for an application. I need to draw a certain shape (circle, rectangle) on a JPanel which follows the mouse move on that JPanel. Well the problem...
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
7
by: john_aspinall | last post by:
Im making my first foray into table-less web site design and have run into a brick wall. This is the URLs: http://www.ainewmedia.co.uk/css_page.htm http://www.ainewmedia.co.uk/css_test.css ...
4
by: Nahum Silva | last post by:
Hi everybody, Im a new user, my question is simple and dont really a pain in the ass, Im using prototype templeates for my project, the problem is when I tried to put an background-image throw this...
2
by: godhulirbalaka | last post by:
Dear Sir/Madam, I have few forms. I want to know that how do i can set a form on top that without close the form no body can go another form of this programme. First he has to close the top form...
9
by: Eric Lindsay | last post by:
How do you provide a consistent gradient fill as a background in a liquid layout? If I make a gradient fill image say 1000 pixels wide (and repeat it down the page) to suit a typical computer...
6
by: 123shailesh | last post by:
Hello everyone, I need some help. I have been working on it for some time but havent been able to think of any solution. Even had thought of making do without it, even though it was a major part...
3
by: kirk | last post by:
I have a form with a PictureBox control on it. The .Image property is set to a PNG file(which shows the picture of the US map) with some transparency in it. The .BackColor property is set to...
9
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have a MDI Container Form, with one label control on the Background of this container form. When I now open a child form, this form is behind the label ... and this looks ugly ... :-))...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
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
0
BarryA
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...
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...

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.