473,807 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dont move the background with it

Thew
69 New Member
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 1926
dlite922
1,584 Recognized Expert Top Contributor
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 New Member
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
Ramil Alcibar
10 New Member
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 New Member
Still the same
Sep 17 '10 #5
Ramil Alcibar
10 New Member
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
2794
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 is the background. I should be transparent and only showing the current shape. I used the paintComponent() method to draw the shape and a mouseMotionListener for realising the move- effects. On runtime, it paints many shapes (one for each mouse...
3
4771
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
1803
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 Im using an inline list for my horizontal navbar items with the right hand border of each <LIitem set to white 1px to create the illusion of a divider between each item.
4
2483
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 way, the background just dont show, and if you write it in the in-line way I mean style="background-image blalba" works fine... my code go something like this... If some one had the same problem or Issue bug etc... please post something... regards...
2
1445
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 then go another form. i.e i have two form. Form-1 is for selected item and Form-2 is contain with item list. Form one has a button for Item list. When i click on the button Form-2 shows. so i want without closing Form-2 nobody goes in Form-1. First...
9
8150
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 display, then only a small portion of the gradient will show if the viewpoint is a smaller PDA or phone display. On the other hand, if viewed full screen on a 1920 pixel wide display, I would run out of gradient on one or both sides of the page....
6
5571
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 of my project. To be honest, I am a beginner and hence unawares about many of the stuff. So here is my problem: I am working on a "PUBLIC TRANSPORT INFORMATION SYSTEM" (In India we dont have one yet for most cities). Currently I am doing it as part...
3
5381
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 Transparent. This so far, works perfect. I now, would like to put another PNG image(an arrow showing positioning on the map) over the last PictureBox. The problem i'm having, the background for this second PictureBox only stays transparent when...
9
8031
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 ... :-)) When I set the label with "SendToBack", it completely disapears. I also tried to set the child form like "BringToFront" but this also does not help.
0
9720
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10626
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10112
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.